commands + gifs: Added more commands and gifs

This commit is contained in:
Sugaryy_ 2023-02-23 19:24:42 +01:00 committed by Yuki Joou
parent 0839b38189
commit 2d30824ec3
2 changed files with 55 additions and 9 deletions

View file

@ -7,7 +7,9 @@
"https://media.tenor.com/J7eGDvGeP9IAAAAC/enage-kiss-anime-hug.gif", "https://media.tenor.com/J7eGDvGeP9IAAAAC/enage-kiss-anime-hug.gif",
"https://media.tenor.com/bEKamK08go8AAAAd/hug-cat.gif" "https://media.tenor.com/bEKamK08go8AAAAd/hug-cat.gif"
], ],
"cuddle": ["https://media.tenor.com/OaSQqWO4-YUAAAAC/snuggle-anime.gif"], "cuddle": [
"https://media.tenor.com/OaSQqWO4-YUAAAAC/snuggle-anime.gif"
],
"hold": [ "hold": [
"https://media.tenor.com/-76rfR0BNTAAAAAC/anime-couple-hand-holding.gif" "https://media.tenor.com/-76rfR0BNTAAAAAC/anime-couple-hand-holding.gif"
], ],
@ -19,5 +21,25 @@
"https://media.tenor.com/weSGHA3VWqwAAAAd/classic-ef-yuri.gif", "https://media.tenor.com/weSGHA3VWqwAAAAd/classic-ef-yuri.gif",
"https://media.tenor.com/0LMxPQdFBKAAAAAC/nekopara-kiss.gif", "https://media.tenor.com/0LMxPQdFBKAAAAAC/nekopara-kiss.gif",
"https://media.discordapp.net/attachments/775642657627832340/1077195063953723482/image1.gif" "https://media.discordapp.net/attachments/775642657627832340/1077195063953723482/image1.gif"
],
"fuck": [
"https://media.discordapp.net/attachments/857047804063907840/1005151333801795625/89CF232B-1310-4577-AECC-B4A143CF6DA1.gif"
],
"wag": [
"https://cdn.discordapp.com/emojis/934937659091075092.gif",
"https://media.discordapp.net/attachments/331911505173807115/1073969787438374962/48D51101-3155-469A-A178-6D002780331E.gif",
"https://cdn.weeb.sh/images/rJCVcytDW.gif"
],
"lewd": [
"https://cdn.weeb.sh/images/H18uap_vb.gif",
"https://cdn.weeb.sh/images/rJgCSpp_wb.gif"
],
"boop": [
"https://media.tenor.com/xEULDAPjA0YAAAAC/boop-anime-anime.gif",
"https://media.tenor.com/l5XjHcppGN0AAAAd/boop.gif",
"https://media.tenor.com/88HZjGgr3k0AAAAd/doggo-boop.gif"
],
"blush": [
"https://tenor.com/view/shy-gif-27191515"
] ]
} }

40
main.py
View file

@ -13,31 +13,55 @@ gifs = {}
with open("gifs.json") as file: with open("gifs.json") as file:
gifs = json.load(file) gifs = json.load(file)
HELP_MESSAGE= """
Commands:
```hug - Hugs target user
kiss - Kisses target user
cuddle - Cuddles with target user
hold - Hold target user's hand
pat - Gives the targeted user headpats
wag - Makes the target user's tail wag
fuck - Does some "stuff" to the target user 😳
flush - Makes the target user blush
lewd - Makes you say that it's too lewd
boop - Boops target user
help - shows this list```
"""
# Commands # Commands
# Gif commands
async def gif_handler(message: discord.Message, command: list[str]): async def command_handler(message: discord.Message, command: list[str]):
gif_kind = command[0] command_typed = command[0]
target = message.author.name target = message.author.name
if len(message.mentions) > 0: if len(message.mentions) > 0:
target = message.mentions[0].name target = message.mentions[0].name
if gif_kind not in gifs: if command_typed == "help":
await message.reply(HELP_MESSAGE)
return
if command_typed not in gifs:
await message.reply( await message.reply(
"im so sorry, i have no such thing to give you for now... come back later :3") "im so sorry, i have no such thing to give you for now... come back later :3")
return return
choosen_gif = random.choice(gifs[gif_kind]) choosen_gif = random.choice(gifs[command_typed])
await message.reply(f"here u go {target}\n{choosen_gif}") await message.reply(f"here u go {target}\n{choosen_gif}")
GIF_COMMANDS = [ COMMANDS = [
"hug", "hug",
"kiss", "kiss",
"cuddle", "cuddle",
"hold", "hold",
"pat", "pat",
"wag",
"fuck",
"blush",
"help",
"lewd",
"boop",
] ]
# Discord events # Discord events
@ -52,8 +76,8 @@ async def on_message(message: discord.Message):
message_as_command = message.content.split(" ") message_as_command = message.content.split(" ")
command = message_as_command[0] command = message_as_command[0]
if command in GIF_COMMANDS: if command in COMMANDS:
await gif_handler(message, message_as_command) await command_handler(message, message_as_command)
client.run(open("token").read()) client.run(open("token").read())