Pepe functionality
This commit is contained in:
parent
362bef1202
commit
c4b6bab452
File diff suppressed because it is too large
Load Diff
|
|
@ -1,10 +1,20 @@
|
|||
# Posts a dank pepe in the chat
|
||||
from discord.ext import commands
|
||||
import discord
|
||||
import random
|
||||
import os
|
||||
|
||||
@commands.command()
|
||||
async def hello(ctx):
|
||||
await ctx.send(f'Hello {ctx.author.display_name}.')
|
||||
plugin_folder=os.path.dirname(os.path.realpath(__file__))
|
||||
pepe_filename=os.path.join(plugin_folder, 'pepes.txt')
|
||||
|
||||
@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):
|
||||
print("I am being loaded!")
|
||||
bot.add_command(hello)
|
||||
print("Rare Pepes initialized")
|
||||
bot.add_command(send_pepe)
|
||||
|
|
|
|||
Loading…
Reference in New Issue