Pepe functionality

This commit is contained in:
cameron committed 2024-05-10 04:27:38 -04:00
1 parent 362bef1202
commit c4b6bab452
2 files changed
+1266 -5

No files matched your search

File diff suppressed because it is too large. Load diff
+15 -5
View File
@@ -1,10 +1,20 @@
# Posts a dank pepe in the chat
from discord.ext import commands from discord.ext import commands
import discord import discord
import random
import os
@commands.command() plugin_folder=os.path.dirname(os.path.realpath(__file__))
async def hello(ctx): pepe_filename=os.path.join(plugin_folder, 'pepes.txt')
await ctx.send(f'Hello {ctx.author.display_name}.')
@commands.command(name='pepe')
async def send_pepe(ctx):
with open(pepe_filename, 'r') as pepe_file:
pepeLines = pepe_file.readlines()
num_pepes = len(pepeLines)
chosen_pepe = pepeLines[random.randint(0,num_pepes-1)]
await ctx.send(f'{chosen_pepe}')
async def setup(bot): async def setup(bot):
print("I am being loaded!") print("Rare Pepes initialized")
bot.add_command(hello) bot.add_command(send_pepe)