예제 #1
0
def emojis():
    return [
        Emoji(id="1", name="swranged", server=None),
        Emoji(id="2", name="swfocus", server=None),
        Emoji(id="3", name="swdisrupt", server=None),
        Emoji(id="4", name="swresource", server=None),
        Emoji(id="5", name="swblank", server=None)
    ]
async def action(message, client):
    line = random.choice(list(open('snooplinks.txt')))
    if random.choice([1, 2, 3, 4, 5]) == 1:  # 4/20 choice to post a video
        msg = '<{0}>'.format(line)
        await client.send_message(message.channel, msg)
    else:
        weedmoj = Emoji(server='Cafe of Broken Dreams',
                        id='260293426401116160')
        await client.add_reaction(message, weedmoj)
예제 #3
0
    def get_emoji(self, **data):
        id_ = data['id']

        if not id_:
            return data['name']

        for server in self.bot.servers:
            for emoji in server.emojis:
                if emoji.id == id_:
                    return emoji
        return Emoji(server=None, **data)
예제 #4
0
파일: bot.py 프로젝트: cxr00/Zote
def create_bot_instance(cfg: Index, dat: dict):
    inst = Bot(command_prefix=cfg["init"]["pre"], pm_help=True)
    reactions = {}
    for each in cfg["hk emoji"]:
        d = Emoji(require_colons=True,
                  managed=False,
                  name=each.tag,
                  id=each.val,
                  server=cfg["init"]["server"])
        reactions.update({each.tag: d})
    for each in cfg["discord emoji"]:
        reactions.update({each.tag: chr(int(each.val))})
    dat.update({"reactions": reactions})
    initialize_events(inst, cfg, dat)
    initialize_commands(inst, cfg, dat)
    return inst
예제 #5
0
def sroll(message):
    """Rolls d6 dice in N format."""
    # Validate syntax
    try:
        rollArg = util.getArg(message.content, 1)
        rolls = int(rollArg)
    except:
        return

    if rolls < 1 or rolls > 30:
        return

    result = ''
    hits = 0
    glitches = 0
    for r in range(0, rolls):
        roll = randint(1, 6)
        if roll >= 5:
            hits += 1
        elif roll == 1:
            glitches += 1
        earr = [
            360257354694000641, 360257354765434892, 360257354853253121,
            360257355142922240, 360257355134402560, 360257355138727946
        ]
        emoji = Emoji(id=earr[roll - 1],
                      server=stormbird.get_server(112471696346255360))
        result += str(emoji)
    glitch = ''
    if glitches > int(rolls / 2):
        if hits == 0:
            glitch = ' - ‼️***Critical Glitch*** ‼'
        else:
            glitch = ' - ❗ ***Glitch*** ❗'

    yield from stormbird.send_message(
        message.channel, '🎲 **' + str(hits) + '** ' + util.pl('hit', hits) +
        glitch + '\n' + result)
예제 #6
0
파일: Emoji.py 프로젝트: ginkoid/bargebot
def setup(bot):
    bot.add_cog(Emoji(bot))
예제 #7
0
파일: emojis.py 프로젝트: holmesmr/marxbot
def create_emoji(_name, _id):
    return Emoji(name=_name, id=_id, server=338594020101980160)