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
|
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)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue