Exemplo n.º 1
0
async def format_quote(quote):
    """
    Formats the quote for final display.

    quote: json string
        -> discord.Embed
    """
    url = f"{quote['url']}"
    content = Embed(title=f"#{quote['id']}: {quote['title']}", url=url)
    content.set_footer(text=f"Author: {quote['author']}")
    content.description = quote['quote']
    content.colour = Colour.lighter_grey()

    return content
Exemplo n.º 2
0
 async def stats(self, ctx):
     """
     Command which returns statistical information for the wallet
     """
     utc_now = datetime.utcnow()
     account_details = self.backoffice.account_mng.get_account_stats(discord_id=ctx.message.author.id)
     stats_info = Embed(title=f':bar_chart: Wallet level 1 statistics :bar_chart: ',
                        description='Below are presented stats which are automatically counted upon successful'
                                    'execution of the commands dedicated to wallet level :one: ',
                        colour=Colour.lighter_grey())
     stats_info.add_field(name=f":symbols: Symbols :symbols: ",
                          value=f':incoming_envelope: -> `SUM of total incoming transactions` \n'
                                f':money_with_wings: -> `SUM of total amount sent per currency` \n'
                                f':envelope_with_arrow:  -> `SUM of total outgoing transactions`\n'
                                f':money_mouth: -> `SUM of total amount received per currency` \n'
                                f':man_juggling: -> `SUM of total roles purchase through merchant system`\n'
                                f':money_with_wings: -> `SUM of total amount spent on merchant system` \n')
     await ctx.author.send(embed=stats_info)
     await custom_messages.stellar_wallet_overall(ctx=ctx, coin_stats=account_details, utc_now=utc_now)
Exemplo n.º 3
0
'''A wrapper to create nice-looking embed-style messages'''
from discord import Embed, Colour

uiEmoji = {
    'tick': [':white_check_mark:', Colour.green()],
    'dollar': [':dollar:', Colour.green()],
    'handshake': [':handshake:', Colour.green()],
    'gear': [':gear:', Colour.lighter_grey()],
    'moneybag': [':moneybag:', Colour.gold()],
    'waiting': [':hourglass:', Colour.gold()],
    'raisedhand': [':raised_hand:', Colour.gold()],
    'winner': [':partying_face:', Colour.blue()],
    'loser': [':pensive:', Colour.blue()],
    'push': [':right_facing_fist:', Colour.blue()],
    'blackjack': ['<:poggers:731761300509818882>',
                  Colour.blue()],
    'die': [':game_die:', Colour.blue()],
    'warning': [':warning:', Colour.red()],
    'error': [':no_entry:', Colour.red()],
}


# A wrapper for creating an dialog box-style embed message.
def dialogBox(messageEmoji,
              messageTitle,
              messageContent=False,
              accentColour='inherit'):
    if not messageContent:
        embed = Embed(title='{emoji}  {title}'.format(
            emoji=uiEmoji[messageEmoji][0], title=messageTitle),
                      colour=uiEmoji[messageEmoji][1])
Exemplo n.º 4
0
from random import seed, randint
from datetime import datetime

seed(datetime.now())

colours = [
    Colour.teal(),
    Colour.dark_teal(),
    Colour.green(),
    Colour.dark_green(),
    Colour.blue(),
    Colour.dark_blue(),
    Colour.purple(),
    Colour.dark_purple(),
    Colour.magenta(),
    Colour.dark_magenta(),
    Colour.gold(),
    Colour.dark_gold(),
    Colour.orange(),
    Colour.dark_orange(),
    Colour.red(),
    Colour.dark_red(),
    Colour.lighter_grey(),
    Colour.light_grey(),
    Colour.dark_grey(),
    Colour.darker_grey(),
    Colour.blurple(),
    Colour.greyple(),
    Colour.from_rgb(randint(0, 255), randint(0, 255), randint(0, 255))
]