Skip to content

Commit

Permalink
feat: pat
Browse files Browse the repository at this point in the history
  • Loading branch information
howardt12345 committed Nov 18, 2023
1 parent 6d2d405 commit 4e54095
Show file tree
Hide file tree
Showing 62 changed files with 45 additions and 0 deletions.
Binary file added commands/pat/gifs/aharen-aharen-san.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/aharensan-aharen.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-anime-headpat.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-couple.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-cute.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-girl.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-head-pat-anime-pat.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-pat (1).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-pat (10).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-pat (11).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-pat (12).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-pat (2).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-pat (3).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-pat (4).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-pat (5).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-pat (6).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-pat (7).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-pat (8).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-pat (9).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-pat.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/anime-senko-san.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/asterisk war pat.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/capoo pat.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/cat-pet.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added commands/pat/gifs/eromanga-sensei-pat-pat-pat.gif
Binary file added commands/pat/gifs/frieren-sousou-no-frieren.gif
Binary file added commands/pat/gifs/head-pat-ya-boy-kongming.gif
Binary file added commands/pat/gifs/head-pat.gif
Binary file added commands/pat/gifs/headpat-anime.gif
Binary file added commands/pat/gifs/horimiya-pat-pat-anime.gif
Binary file added commands/pat/gifs/kaede-azusagawa-kaede.gif
Binary file added commands/pat/gifs/love-stroke.gif
Binary file added commands/pat/gifs/mai-sakurajima.gif
Binary file added commands/pat/gifs/mala-mishra-jha-pat-head.gif
Binary file added commands/pat/gifs/menhera-chan-anime.gif
Binary file added commands/pat/gifs/milk-and-mocha-pat.gif
Binary file added commands/pat/gifs/pat (1).gif
Binary file added commands/pat/gifs/pat (2).gif
Binary file added commands/pat/gifs/pat (3).gif
Binary file added commands/pat/gifs/pat (4).gif
Binary file added commands/pat/gifs/pat (5).gif
Binary file added commands/pat/gifs/pat-anime.gif
Binary file added commands/pat/gifs/pat-cat.gif
Binary file added commands/pat/gifs/pat-good.gif
Binary file added commands/pat/gifs/pat-pat (1).gif
Binary file added commands/pat/gifs/pat-pat (2).gif
Binary file added commands/pat/gifs/pat-pat.gif
Binary file added commands/pat/gifs/pat.gif
Binary file added commands/pat/gifs/pikachu-cute.gif
Binary file added commands/pat/gifs/pikachu-sadness.gif
Binary file added commands/pat/gifs/project-sekai-pjsk.gif
Binary file added commands/pat/gifs/qualidea-code-head-pat.gif
Binary file added commands/pat/gifs/rika-higurashi.gif
Binary file added commands/pat/gifs/ruby-ruby-hoshino.gif
Binary file added commands/pat/gifs/spy-x-family-anya-forger.gif
Binary file added commands/pat/gifs/spy-x-family-anya.gif
Binary file added commands/pat/gifs/tohru-kobayashi.gif
43 changes: 43 additions & 0 deletions commands/pat/pat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import time
import discord
from ..modules import logging
from discord import app_commands
from pathlib import Path
from random import choice
import os

PAT_DIR = Path(Path(__file__).parent, 'gifs')


def register_commands(tree, guilds: list[discord.Object]):
@tree.command(
name="pat",
description="Pat",
guilds=guilds,
)
@app_commands.rename(user_to_pat='member')
async def pat(interaction: discord.Interaction, user_to_pat: discord.Member, text: str = None):
current_user_id = interaction.user.id

# random file from the directory
random_gif = choice(list(PAT_DIR.iterdir()))

log_event = {
"event": "pat",
"author_id": current_user_id,
"mentioned_id": user_to_pat.id,
}

# await logging.log_event(interaction, log_event, log_to_channel=False)

embed = discord.Embed()

# set the title of the embed
embed.title = f"{interaction.user.display_name} pats {user_to_pat.display_name} {text if text else ''}"
embed.color = discord.Color.random()

# add the file to the embed
file = discord.File(random_gif)
embed.set_image(url=f"attachment://{file.filename}")

await interaction.response.send_message(embed=embed, file=file)
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from commands.modules import logging
from commands.one_o_one import one_o_one
from commands import hgs
from commands.pat import pat
from commands.reacttw import react_tw
from commands.react_ua import react_ua
from commands.react_baltics import react_baltics
Expand Down Expand Up @@ -96,6 +97,7 @@ async def deployment_info(interaction: discord.Interaction):
boba.register_commands(tree, guilds)
basic_commands.register_commands(tree, guilds)
config_commands.register_commands(tree, client, guilds)
pat.register_commands(tree, guilds)

# confessions needs the dictionary for the confession channel id
confession.register_commands(tree, client)
Expand Down

0 comments on commit 4e54095

Please sign in to comment.