✨ Converted misc functionality to slash commands
This commit is contained in:
14
Gwendolyn.py
14
Gwendolyn.py
@ -36,6 +36,20 @@ class Gwendolyn(commands.Bot):
|
|||||||
def log(self, messages, channel : str = "", level : int = 20):
|
def log(self, messages, channel : str = "", level : int = 20):
|
||||||
logThis(messages, channel, level)
|
logThis(messages, channel, level)
|
||||||
|
|
||||||
|
async def stop(self, ctx):
|
||||||
|
if f"#{ctx.author.id}" in self.options.admins:
|
||||||
|
await ctx.send("Pulling git repo and restarting...")
|
||||||
|
|
||||||
|
await self.change_presence(status = discord.Status.offline)
|
||||||
|
|
||||||
|
self.databaseFuncs.stopServer()
|
||||||
|
|
||||||
|
self.log("Logging out", level = 25)
|
||||||
|
await self.logout()
|
||||||
|
else:
|
||||||
|
self.log(f"{ctx.author.display_name} tried to stop me! (error code 201)",str(ctx.channel_id))
|
||||||
|
await ctx.send(f"I don't think I will, {ctx.author.display_name} (error code 201)")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -2,16 +2,9 @@ import discord, codecs, string, json
|
|||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from discord_slash import cog_ext
|
from discord_slash import cog_ext
|
||||||
|
|
||||||
from utils import Options
|
from utils import getParams
|
||||||
|
|
||||||
with open("resources/slashParameters.json", "r") as f:
|
params = getParams()
|
||||||
params = json.load(f)
|
|
||||||
|
|
||||||
options = Options()
|
|
||||||
|
|
||||||
if options.testing:
|
|
||||||
for p in params:
|
|
||||||
params[p]["guild_ids"] = options.guildIds
|
|
||||||
|
|
||||||
class MiscCog(commands.Cog):
|
class MiscCog(commands.Cog):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
@ -30,33 +23,12 @@ class MiscCog(commands.Cog):
|
|||||||
# Restarts the bot
|
# Restarts the bot
|
||||||
@cog_ext.cog_slash(**params["stop"])
|
@cog_ext.cog_slash(**params["stop"])
|
||||||
async def stop(self, ctx):
|
async def stop(self, ctx):
|
||||||
if "#"+str(ctx.author.id) in self.bot.options.admins:
|
await self.bot.stop(ctx)
|
||||||
await ctx.send("Pulling git repo and restarting...")
|
|
||||||
|
|
||||||
await self.bot.change_presence(status = discord.Status.offline)
|
|
||||||
|
|
||||||
self.bot.databaseFuncs.stopServer()
|
|
||||||
|
|
||||||
self.bot.log("Logging out.")
|
|
||||||
await self.bot.logout()
|
|
||||||
else:
|
|
||||||
self.bot.log(f"{ctx.author.display_name} tried to stop me! (error code 201)",str(ctx.channel_id))
|
|
||||||
await ctx.send(f"I don't think I will, {ctx.author.display_name} (error code 201)")
|
|
||||||
|
|
||||||
# Gets help for specific command
|
# Gets help for specific command
|
||||||
@cog_ext.cog_slash(**params["help"])
|
@cog_ext.cog_slash(**params["help"])
|
||||||
async def helpCommand(self, ctx, command = ""):
|
async def helpCommand(self, ctx, command = ""):
|
||||||
if command == "":
|
await self.bot.other.helpFunc(ctx, command)
|
||||||
with codecs.open("resources/help/help.txt",encoding="utf-8") as f:
|
|
||||||
text = f.read()
|
|
||||||
em = discord.Embed(title = "Help", description = text,colour = 0x59f442)
|
|
||||||
await ctx.send(embed = em)
|
|
||||||
else:
|
|
||||||
self.bot.log(f"Looking for help-{command}.txt",str(ctx.channel_id))
|
|
||||||
with codecs.open(f"resources/help/help-{command}.txt",encoding="utf-8") as f:
|
|
||||||
text = f.read()
|
|
||||||
em = discord.Embed(title = command.capitalize(), description = text,colour = 0x59f442)
|
|
||||||
await ctx.send(embed = em)
|
|
||||||
|
|
||||||
# Lets you thank the bot
|
# Lets you thank the bot
|
||||||
@cog_ext.cog_slash(**params["thank"])
|
@cog_ext.cog_slash(**params["thank"])
|
||||||
@ -66,67 +38,51 @@ class MiscCog(commands.Cog):
|
|||||||
# Sends a friendly message
|
# Sends a friendly message
|
||||||
@cog_ext.cog_slash(**params["hello"])
|
@cog_ext.cog_slash(**params["hello"])
|
||||||
async def hello(self, ctx):
|
async def hello(self, ctx):
|
||||||
await ctx.send(self.bot.other.helloFunc(ctx.author.display_name))
|
await self.bot.other.helloFunc(ctx)
|
||||||
|
|
||||||
# Rolls dice
|
# Rolls dice
|
||||||
@cog_ext.cog_slash(**params["roll"])
|
@cog_ext.cog_slash(**params["roll"])
|
||||||
async def roll(self, ctx, dice = "1d20"):
|
async def roll(self, ctx, dice = "1d20"):
|
||||||
await ctx.send(self.bot.other.rollDice(ctx.author.display_name, dice))
|
await self.bot.other.rollDice(ctx, dice)
|
||||||
|
|
||||||
# Sends a random image
|
# Sends a random image
|
||||||
@cog_ext.cog_slash(**params["image"])
|
@cog_ext.cog_slash(**params["image"])
|
||||||
async def image(self, ctx):
|
async def image(self, ctx):
|
||||||
await ctx.defer()
|
await self.bot.other.imageFunc(ctx)
|
||||||
await ctx.send(self.bot.other.imageFunc())
|
|
||||||
|
|
||||||
# Finds a random movie
|
# Finds a random movie
|
||||||
@cog_ext.cog_slash(**params["movie"])
|
@cog_ext.cog_slash(**params["movie"])
|
||||||
async def movie(self,ctx):
|
async def movie(self, ctx):
|
||||||
await self.bot.other.movieFunc(ctx)
|
await self.bot.other.movieFunc(ctx)
|
||||||
|
|
||||||
# Generates a random name
|
# Generates a random name
|
||||||
@cog_ext.cog_slash(**params["name"])
|
@cog_ext.cog_slash(**params["name"])
|
||||||
async def name(self, ctx):
|
async def name(self, ctx):
|
||||||
await ctx.send(self.generators.nameGen())
|
await self.generators.nameGen(ctx)
|
||||||
|
|
||||||
# Generates a random tavern name
|
# Generates a random tavern name
|
||||||
@cog_ext.cog_slash(**params["tavern"])
|
@cog_ext.cog_slash(**params["tavern"])
|
||||||
async def tavern(self, ctx):
|
async def tavern(self, ctx):
|
||||||
await ctx.send(self.generators.tavernGen())
|
await self.generators.tavernGen(ctx)
|
||||||
|
|
||||||
# Finds a page on the Senkulpa wiki
|
# Finds a page on the Senkulpa wiki
|
||||||
@cog_ext.cog_slash(**params["wiki"])
|
@cog_ext.cog_slash(**params["wiki"])
|
||||||
async def wiki(self, ctx, wikiPage):
|
async def wiki(self, ctx, wikiPage):
|
||||||
await ctx.defer()
|
await self.bot.other.findWikiPage(ctx, wikiPage)
|
||||||
command = string.capwords(wikiPage)
|
|
||||||
title, content, thumbnail = self.bot.otherfindWikiPage(command)
|
|
||||||
if title != "":
|
|
||||||
self.bot.log("Sending the embedded message",str(ctx.channel_id))
|
|
||||||
content += "\n[Læs mere](https://senkulpa.fandom.com/da/wiki/"+title.replace(" ","_")+")"
|
|
||||||
embed = discord.Embed(title = title, description = content, colour=0xDEADBF)
|
|
||||||
if thumbnail != "":
|
|
||||||
embed.set_thumbnail(url=thumbnail)
|
|
||||||
|
|
||||||
await ctx.send(embed = embed)
|
|
||||||
else:
|
|
||||||
await ctx.send(content)
|
|
||||||
|
|
||||||
#Searches for movie and adds it to Bedre Netflix
|
#Searches for movie and adds it to Bedre Netflix
|
||||||
@cog_ext.cog_slash(**params["addMovie"])
|
@cog_ext.cog_slash(**params["addMovie"])
|
||||||
async def addMovie(self, ctx, movie):
|
async def addMovie(self, ctx, movie):
|
||||||
await ctx.defer()
|
|
||||||
await self.bedreNetflix.requestMovie(ctx, movie)
|
await self.bedreNetflix.requestMovie(ctx, movie)
|
||||||
|
|
||||||
#Searches for show and adds it to Bedre Netflix
|
#Searches for show and adds it to Bedre Netflix
|
||||||
@cog_ext.cog_slash(**params["addShow"])
|
@cog_ext.cog_slash(**params["addShow"])
|
||||||
async def addShow(self, ctx, show):
|
async def addShow(self, ctx, show):
|
||||||
await ctx.defer()
|
|
||||||
await self.bedreNetflix.requestShow(ctx, show)
|
await self.bedreNetflix.requestShow(ctx, show)
|
||||||
|
|
||||||
#Returns currently downloading torrents
|
#Returns currently downloading torrents
|
||||||
@cog_ext.cog_slash(**params["downloading"])
|
@cog_ext.cog_slash(**params["downloading"])
|
||||||
async def downloading(self, ctx, parameters = "-d"):
|
async def downloading(self, ctx, parameters = "-d"):
|
||||||
await ctx.defer()
|
|
||||||
await self.bedreNetflix.downloading(ctx, parameters)
|
await self.bedreNetflix.downloading(ctx, parameters)
|
||||||
|
|
||||||
#Looks up on Wolfram Alpha
|
#Looks up on Wolfram Alpha
|
||||||
|
@ -13,6 +13,8 @@ class BedreNetflix():
|
|||||||
|
|
||||||
#Returns a list of no more than 5 options when user requests a movie
|
#Returns a list of no more than 5 options when user requests a movie
|
||||||
async def requestMovie(self, ctx, movieName):
|
async def requestMovie(self, ctx, movieName):
|
||||||
|
await ctx.defer()
|
||||||
|
|
||||||
self.bot.log("Searching for "+movieName)
|
self.bot.log("Searching for "+movieName)
|
||||||
movieList = imdb.IMDb().search_movie(movieName)
|
movieList = imdb.IMDb().search_movie(movieName)
|
||||||
movies = []
|
movies = []
|
||||||
@ -89,6 +91,8 @@ class BedreNetflix():
|
|||||||
|
|
||||||
#Returns a list of no more than 5 options when user requests a show
|
#Returns a list of no more than 5 options when user requests a show
|
||||||
async def requestShow(self, ctx, showName):
|
async def requestShow(self, ctx, showName):
|
||||||
|
await ctx.defer()
|
||||||
|
|
||||||
self.bot.log("Searching for "+showName)
|
self.bot.log("Searching for "+showName)
|
||||||
movies = imdb.IMDb().search_movie(showName) #Replace with tvdb
|
movies = imdb.IMDb().search_movie(showName) #Replace with tvdb
|
||||||
shows = []
|
shows = []
|
||||||
@ -301,6 +305,8 @@ class BedreNetflix():
|
|||||||
await ctx.send("```"+messageText[:cutOffIndex]+"```")
|
await ctx.send("```"+messageText[:cutOffIndex]+"```")
|
||||||
await SendLongMessage(ctx,messageText[cutOffIndex+1:])
|
await SendLongMessage(ctx,messageText[cutOffIndex+1:])
|
||||||
|
|
||||||
|
await ctx.defer()
|
||||||
|
|
||||||
# showDM, showMovies, showShows, episodes
|
# showDM, showMovies, showShows, episodes
|
||||||
params = [False, False, False, False]
|
params = [False, False, False, False]
|
||||||
showDMArgs = ["d", "dm", "downloading", "downloadmanager"]
|
showDMArgs = ["d", "dm", "downloading", "downloadmanager"]
|
||||||
|
@ -15,7 +15,7 @@ class Generators():
|
|||||||
yield (corpus[i], corpus[i+1], corpus[i+2])
|
yield (corpus[i], corpus[i+1], corpus[i+2])
|
||||||
|
|
||||||
# Generates a random name
|
# Generates a random name
|
||||||
def nameGen(self):
|
async def nameGen(self, ctx):
|
||||||
# Makes a list of all names from "names.txt"
|
# Makes a list of all names from "names.txt"
|
||||||
names = open('resources/names.txt', encoding='utf8').read()
|
names = open('resources/names.txt', encoding='utf8').read()
|
||||||
corpus = list(names)
|
corpus = list(names)
|
||||||
@ -74,11 +74,12 @@ class Generators():
|
|||||||
done = True
|
done = True
|
||||||
genName = "".join(chain)
|
genName = "".join(chain)
|
||||||
self.bot.log("Generated "+genName[:-1])
|
self.bot.log("Generated "+genName[:-1])
|
||||||
|
|
||||||
# Returns the name
|
# Returns the name
|
||||||
return(genName)
|
await ctx.send(genName)
|
||||||
|
|
||||||
# Generates a random tavern name
|
# Generates a random tavern name
|
||||||
def tavernGen(self):
|
async def tavernGen(self, ctx):
|
||||||
# Lists first parts, second parts and third parts of tavern names
|
# Lists first parts, second parts and third parts of tavern names
|
||||||
fp = ["The Silver","The Golden","The Staggering","The Laughing","The Prancing","The Gilded","The Running","The Howling","The Slaughtered","The Leering","The Drunken","The Leaping","The Roaring","The Frowning","The Lonely","The Wandering","The Mysterious","The Barking","The Black","The Gleaming","The Tap-Dancing","The Sad","The Sexy","The Artificial","The Groovy","The Merciful","The Confused","The Pouting","The Horny","The Okay","The Friendly","The Hungry","The Handicapped","The Fire-breathing","The One-Eyed","The Psychotic","The Mad","The Evil","The Idiotic","The Trusty","The Busty"]
|
fp = ["The Silver","The Golden","The Staggering","The Laughing","The Prancing","The Gilded","The Running","The Howling","The Slaughtered","The Leering","The Drunken","The Leaping","The Roaring","The Frowning","The Lonely","The Wandering","The Mysterious","The Barking","The Black","The Gleaming","The Tap-Dancing","The Sad","The Sexy","The Artificial","The Groovy","The Merciful","The Confused","The Pouting","The Horny","The Okay","The Friendly","The Hungry","The Handicapped","The Fire-breathing","The One-Eyed","The Psychotic","The Mad","The Evil","The Idiotic","The Trusty","The Busty"]
|
||||||
sp = ["Eel","Dolphin","Dwarf","Pegasus","Pony","Rose","Stag","Wolf","Lamb","Demon","Goat","Spirit","Horde","Jester","Mountain","Eagle","Satyr","Dog","Spider","Star","Dad","Rat","Jeremy","Mouse","Unicorn","Pearl","Ant","Crab","Penguin","Octopus","Lawyer","Ghost","Toad","Handjob","Immigrant","SJW","Dragon","Bard","Sphinx","Soldier","Salmon","Owlbear","Kite","Frost Giant","Arsonist"]
|
sp = ["Eel","Dolphin","Dwarf","Pegasus","Pony","Rose","Stag","Wolf","Lamb","Demon","Goat","Spirit","Horde","Jester","Mountain","Eagle","Satyr","Dog","Spider","Star","Dad","Rat","Jeremy","Mouse","Unicorn","Pearl","Ant","Crab","Penguin","Octopus","Lawyer","Ghost","Toad","Handjob","Immigrant","SJW","Dragon","Bard","Sphinx","Soldier","Salmon","Owlbear","Kite","Frost Giant","Arsonist"]
|
||||||
@ -89,4 +90,4 @@ class Generators():
|
|||||||
self.bot.log("Generated "+genTav)
|
self.bot.log("Generated "+genTav)
|
||||||
|
|
||||||
# Return the name
|
# Return the name
|
||||||
return(genTav)
|
await ctx.send(genTav)
|
||||||
|
@ -10,6 +10,8 @@ from .bedreNetflix import BedreNetflix
|
|||||||
from .nerdShit import NerdShit
|
from .nerdShit import NerdShit
|
||||||
from .generators import Generators
|
from .generators import Generators
|
||||||
|
|
||||||
|
from utils import cap
|
||||||
|
|
||||||
class MyStringifier(d20.MarkdownStringifier):
|
class MyStringifier(d20.MarkdownStringifier):
|
||||||
def _str_expression(self, node):
|
def _str_expression(self, node):
|
||||||
if node.comment == None:
|
if node.comment == None:
|
||||||
@ -57,29 +59,31 @@ class Other():
|
|||||||
await ctx.send(embed = embed)
|
await ctx.send(embed = embed)
|
||||||
|
|
||||||
# Responds with a greeting of a time-appropriate maner
|
# Responds with a greeting of a time-appropriate maner
|
||||||
def helloFunc(self, author):
|
async def helloFunc(self, ctx):
|
||||||
def time_in_range(start, end, x):
|
def time_in_range(start, end, x):
|
||||||
# Return true if x is in the range [start, end]
|
# Return true if x is in the range [start, end]
|
||||||
if start <= end:
|
if start <= end:
|
||||||
return start <= x <= end
|
return start <= x <= end
|
||||||
else:
|
else:
|
||||||
return start <= x or x <= end
|
return start <= x or x <= end
|
||||||
|
|
||||||
|
author = ctx.author.display_name
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
if time_in_range(now.replace(hour=5, minute=0, second=0, microsecond=0),now.replace(hour=10, minute=0, second=0, microsecond=0), now):
|
if time_in_range(now.replace(hour=5, minute=0, second=0, microsecond=0),now.replace(hour=10, minute=0, second=0, microsecond=0), now):
|
||||||
return("Good morning, "+str(author))
|
sendMessage = "Good morning, "+str(author)
|
||||||
elif time_in_range(now.replace(hour=10, minute=0, second=0, microsecond=0),now.replace(hour=13, minute=0, second=0, microsecond=0), now):
|
|
||||||
return("Good day, "+str(author))
|
|
||||||
elif time_in_range(now.replace(hour=13, minute=0, second=0, microsecond=0),now.replace(hour=18, minute=0, second=0, microsecond=0), now):
|
elif time_in_range(now.replace(hour=13, minute=0, second=0, microsecond=0),now.replace(hour=18, minute=0, second=0, microsecond=0), now):
|
||||||
return("Good afternoon, "+str(author))
|
sendMessage = "Good afternoon, "+str(author)
|
||||||
elif time_in_range(now.replace(hour=18, minute=0, second=0, microsecond=0),now.replace(hour=22, minute=0, second=0, microsecond=0), now):
|
elif time_in_range(now.replace(hour=18, minute=0, second=0, microsecond=0),now.replace(hour=22, minute=0, second=0, microsecond=0), now):
|
||||||
return("Good evening, "+str(author))
|
sendMessage = "Good evening, "+str(author)
|
||||||
elif time_in_range(now.replace(hour=22, minute=0, second=0, microsecond=0),now.replace(hour=23, minute=59, second=59, microsecond=0), now):
|
elif time_in_range(now.replace(hour=22, minute=0, second=0, microsecond=0),now.replace(hour=23, minute=59, second=59, microsecond=0), now):
|
||||||
return("Good night, "+str(author))
|
sendMessage = "Good night, "+str(author)
|
||||||
else:
|
else:
|
||||||
return("Hello, "+str(author))
|
sendMessage = "Hello, "+str(author)
|
||||||
|
|
||||||
|
await ctx.send(sendMessage)
|
||||||
|
|
||||||
# Finds a random picture online
|
# Finds a random picture online
|
||||||
def imageFunc(self):
|
async def imageFunc(self, ctx):
|
||||||
# Picks a type of camera, which decides the naming scheme
|
# Picks a type of camera, which decides the naming scheme
|
||||||
cams = ("one","two","three","four")
|
cams = ("one","two","three","four")
|
||||||
cam = random.choice(cams)
|
cam = random.choice(cams)
|
||||||
@ -113,22 +117,31 @@ class Other():
|
|||||||
tree = lxml.etree.HTML(read)
|
tree = lxml.etree.HTML(read)
|
||||||
images = tree.xpath('//a[@class = "thumb"]/@href')
|
images = tree.xpath('//a[@class = "thumb"]/@href')
|
||||||
|
|
||||||
# Picks an image
|
if len(images) == 0:
|
||||||
number = random.randint(1,len(images))-1
|
await ctx.send("Found no images")
|
||||||
image = images[number]
|
else:
|
||||||
|
# Picks an image
|
||||||
|
number = random.randint(1,len(images))-1
|
||||||
|
image = images[number]
|
||||||
|
|
||||||
self.bot.log("Picked image number "+str(number))
|
self.bot.log("Picked image number "+str(number))
|
||||||
|
|
||||||
# Returns the image
|
# Returns the image
|
||||||
self.bot.log("Successfully returned an image")
|
self.bot.log("Successfully returned an image")
|
||||||
return(image)
|
|
||||||
|
await ctx.send(image)
|
||||||
|
|
||||||
# Finds a page from the Senkulpa Wikia
|
# Finds a page from the Senkulpa Wikia
|
||||||
def findWikiPage(self, search : str):
|
async def findWikiPage(self, ctx, search : str):
|
||||||
|
await ctx.defer()
|
||||||
|
search = cap(search)
|
||||||
|
foundPage = False
|
||||||
|
|
||||||
self.bot.log("Trying to find wiki page for "+search)
|
self.bot.log("Trying to find wiki page for "+search)
|
||||||
wikia.set_lang("da")
|
wikia.set_lang("da")
|
||||||
searchResults = wikia.search("senkulpa",search)
|
searchResults = wikia.search("senkulpa",search)
|
||||||
if len(searchResults) > 0:
|
if len(searchResults) > 0:
|
||||||
|
foundPage = True
|
||||||
searchResult = searchResults[0].replace(",","%2C")
|
searchResult = searchResults[0].replace(",","%2C")
|
||||||
self.bot.log("Found page \""+searchResult+"\"")
|
self.bot.log("Found page \""+searchResult+"\"")
|
||||||
page = wikia.page("senkulpa",searchResult)
|
page = wikia.page("senkulpa",searchResult)
|
||||||
@ -137,15 +150,39 @@ class Other():
|
|||||||
images = page.images
|
images = page.images
|
||||||
if len(images) > 0:
|
if len(images) > 0:
|
||||||
image = images[len(images)-1]+"/revision/latest?path-prefix=da"
|
image = images[len(images)-1]+"/revision/latest?path-prefix=da"
|
||||||
return page.title, content, image
|
|
||||||
else:
|
else:
|
||||||
return page.title, content, ""
|
image = ""
|
||||||
else:
|
else:
|
||||||
self.bot.log("Couldn't find the page (error code 1002)")
|
self.bot.log("Couldn't find the page")
|
||||||
return "", "Couldn't find page (error code 1002)", ""
|
await ctx.send("Couldn't find page (error code 1002)")
|
||||||
|
|
||||||
def rollDice(self, user, rollString):
|
if foundPage:
|
||||||
|
self.bot.log("Sending the embedded message",str(ctx.channel_id))
|
||||||
|
content += f"\n[Læs mere]({page.url})"
|
||||||
|
embed = discord.Embed(title = page.title, description = content, colour=0xDEADBF)
|
||||||
|
if image != "":
|
||||||
|
embed.set_thumbnail(url=image)
|
||||||
|
|
||||||
|
await ctx.send(embed = embed)
|
||||||
|
|
||||||
|
async def rollDice(self, ctx, rollString):
|
||||||
|
user = ctx.author.display_name
|
||||||
while len(rollString) > 1 and rollString[0] == " ":
|
while len(rollString) > 1 and rollString[0] == " ":
|
||||||
rollString = rollString[1:]
|
rollString = rollString[1:]
|
||||||
return user+" :game_die:\n"+str(d20.roll(rollString, allow_comments=True,stringifier=MyStringifier()))
|
|
||||||
|
roll = d20.roll(rollString, allow_comments=True, stringifier=MyStringifier())
|
||||||
|
await ctx.send(f"{user} :game_die:\n{roll}")
|
||||||
|
|
||||||
|
async def helpFunc(self, ctx, command):
|
||||||
|
if command == "":
|
||||||
|
with open("resources/help/help.txt",encoding="utf-8") as f:
|
||||||
|
text = f.read()
|
||||||
|
em = discord.Embed(title = "Help", description = text,colour = 0x59f442)
|
||||||
|
await ctx.send(embed = em)
|
||||||
|
else:
|
||||||
|
self.bot.log(f"Looking for help-{command}.txt",str(ctx.channel_id))
|
||||||
|
with open(f"resources/help/help-{command}.txt",encoding="utf-8") as f:
|
||||||
|
text = f.read()
|
||||||
|
em = discord.Embed(title = command.capitalize(), description = text,colour = 0x59f442)
|
||||||
|
await ctx.send(embed = em)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user