diff --git a/help/help.md b/help/help.md index 72bbf64..fa03eda 100644 --- a/help/help.md +++ b/help/help.md @@ -8,5 +8,5 @@ Standard diceroller which works with the 1dX notation. See `!help roll` for more `# GIF embeds` For servers that want to disable embeds for any reason (triggers, unwanted imagery, etc), this function will make sure that (for specific channels configured in the config) gif URLs are picked up by the bot and embedded. This whole functionality is used for a problem that shouldn't be there in the first place, but because GIFs are linked to the Embed setting in Discord, for some servers this might pose a solution. -`# LARP Zomer Festival Babbelbingo` -For the LARP Zomer Festival babbelbingo, you can use the `!bingo` command anywhere on the LARP Platform Discord Server. You will get a Babbelbingo card in PM. You can use the `!bingo` command again for a new card if your old one is done or if you want a new one with other questions. +`# LARP Platform Babbelbingo` +For the LARP Platform babbelbingo, you can use the `!bingo` command anywhere on the LARP Platform Discord Server. You will get a babbelbingo card in PM. You can use the `!bingo` command again for a new card if your old one is done or if you want a new one with other questions. diff --git a/jeeves.py b/jeeves.py index 9aac258..83cac7b 100755 --- a/jeeves.py +++ b/jeeves.py @@ -2,8 +2,6 @@ import discord from discord.ext import commands -# from discord.ext.commands import bot -from discord.utils import get import logging from jeevesbot import bothelp, functions, env, babbelbingo @@ -17,25 +15,13 @@ logger.addHandler(handler) # setup discord.py bot intents = discord.Intents().all() -client = commands.Bot(command_prefix='!', intents=intents) +bot = commands.Bot(command_prefix='!', intents=intents) e = discord.Embed() -# listen for emojis (set message id and role id in env.py) -@client.event -async def on_raw_reaction_add(payload): - message = await client.get_channel(payload.channel_id).fetch_message(payload.message_id) - guild_id = payload.guild_id - guild = discord.utils.find(lambda g: g.id == guild_id, client.guilds) - member = discord.utils.get(guild.members, id=payload.user_id) - role = guild.get_role(env.EMOJIREACTROLE) - reaction = discord.utils.get(message.reactions, emoji="☎️") - if message.id in env.EMOJIREACTMSG and reaction is not None: - await member.add_roles(role) - -@client.event +@bot.event async def on_message(message): # we do not want the bot to reply to itself - if message.author == client.user: + if message.author == bot.user: return if message.content.startswith('!help'): parameters = message.content.split(' ', 1) @@ -93,7 +79,7 @@ async def on_message(message): name = message.author.name bingocard = babbelbingo.bingo(name) guild_id = message.guild.id - guild = discord.utils.find(lambda g: g.id == guild_id, client.guilds) + guild = discord.utils.find(lambda g: g.id == guild_id, bot.guilds) member = discord.utils.get(guild.members, id=message.author.id) role = discord.utils.get(guild.roles , name='babbelbingo') await message.author.send(file=discord.File(bingocard)) @@ -108,11 +94,11 @@ async def on_message(message): msg = 'https://bunq.me/larpzomerfestival' await message.channel.send(msg) -@client.event +@bot.event async def on_ready(): - print('### Active with id %s as %s ###' % (client.user.id,client.user.name) ) + print('### Active with id %s as %s ###' % (bot.user.id,bot.user.name) ) activity = discord.Activity(name='!help', type=discord.ActivityType.listening) - await client.change_presence(activity=activity) + await bot.change_presence(activity=activity) if __name__ == '__main__': - client.run(env.TOKEN) + bot.run(env.TOKEN) diff --git a/requirements.txt b/requirements.txt index 559ae2f..a094b1d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,9 +10,7 @@ typing-extensions pylint gspread oauth2client +Pillow # needs this version, otherwise TypeErrors will break stuff yarl==1.4.2 - -# babbelbingo -Pillow diff --git a/scripts/emojivvdd.py b/scripts/emojivvdd.py index 02dd51d..fcbc5dc 100644 --- a/scripts/emojivvdd.py +++ b/scripts/emojivvdd.py @@ -1,17 +1,13 @@ #!/usr/bin/env python3 -from collections import defaultdict import time import discord from discord.ext import commands import sys import ast -import itertools -from discord.utils import get +from ..jeevesbot import env -from pyasn1.type.constraint import PermittedAlphabetConstraint - -# general @ test = 749399756752814105 +## Standalone script for emoji-vvdd # setup discord.py bot intents = discord.Intents().all() @@ -32,7 +28,7 @@ async def score(question, score): async def run_script(params): params = params - channel = client.get_channel(790908319005933598) # vvdd 729667183126511617 # tech 790908319005933598 # test 749399756752814105 + channel = client.get_channel(729667183126511617) # vvdd 729667183126511617 # tech 790908319005933598 # test 749399756752814105 emoji_numbers = ['1️⃣', '2️⃣', '3️⃣', '4️⃣', '5️⃣', '6️⃣', '7️⃣', '8️⃣', '9️⃣'] question = params[0] # string answers = ast.literal_eval(params[1]) # list @@ -72,6 +68,7 @@ async def run_script(params): f.set_author(name='Jeeves', icon_url='https://cdn.hippogrief.nl/jeevesbot/jeeves.jpg') f.add_field(name=question, value='\u200b', inline=False) f.add_field(name=hoogste_score, value=score, inline=False) + f.set_footer(text="Je mag blijven doorstemmen, deze tussenstand zal niet worden bijgewerkt meer verder.") f.set_thumbnail(url='https://cdn.hippogrief.nl/jeevesbot/logo.jpg') message = await channel.send(embed=f) @@ -85,4 +82,4 @@ async def on_ready(): await run_script(params) if __name__ == '__main__': - client.run('ODE5NjMyNDg1MjU5ODA0NzU0.YEpcPA.I-i1tDIV1vP7FW6-8cA7YLH5lN4') \ No newline at end of file + client.run(env.TOKEN) diff --git a/scripts/jeeves.jpg b/scripts/jeeves.jpg deleted file mode 100644 index ff800f8..0000000 Binary files a/scripts/jeeves.jpg and /dev/null differ diff --git a/scripts/logo.svg b/scripts/logo.svg deleted file mode 100644 index eea1cf6..0000000 --- a/scripts/logo.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - -