コード例 #1
0
def on_reaction_add(reaction, user):
    if user == client.user:
        return
    if reaction.emoji == '🎁':
        Command.joinInvisibleFriend(reaction.message.id, user)
    if reaction.emoji == '▶️':
        Command.startInvisibleFriend(reaction.message.id, user)
    if reaction.emoji == '⚙️':
        Command.sendSettingsInvisibleFriend(reaction.message.id, user)
    if reaction.emoji == '🔫':
        Command.shootRusseRoulette(reaction.message.id, user)

    # From here random reactions
    if reaction.message.author == client.user:
        return
    if random.randint(0, 100) == 0:
        yield from reaction.message.add_reaction(reaction.emoji)
コード例 #2
0
ファイル: bot.py プロジェクト: PuppedToy/mozob-bot
def on_reaction_add(reaction, user):
    if user == client.user:
        return
    if reaction.emoji == '🎁':
        Command.joinInvisibleFriend(reaction.message.id, user)
    if reaction.emoji == '▶️':
        Command.startInvisibleFriend(reaction.message.id, user)
    if reaction.emoji == '⚙️':
        Command.sendSettingsInvisibleFriend(reaction.message.id, user)
    if reaction.emoji == '🔫':
        Command.shootRusseRoulette(reaction.message.id, user)

    if user.bot:
        kakeraType = re.findall('^<:(kakera.?):', str(reaction.emoji))
        if len(kakeraType) > 0:
            Command.kakeraBroadcast(reaction.message.channel, kakeraType[0])

    # From here random reactions
    if reaction.message.author == client.user:
        return
    if random.randint(0, 100) == 0:
        yield from reaction.message.add_reaction(reaction.emoji)