Moving
This commit is contained in:
21
cogs/info.py
21
cogs/info.py
@@ -1,11 +1,10 @@
|
||||
import logging
|
||||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from dislash import slash_command
|
||||
import disnake
|
||||
from disnake.ext import commands
|
||||
|
||||
|
||||
class Bot_info(commands.Cog):
|
||||
class Bot_info(commands.Cog, name='Bot Info'):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot # defining bot as global var in class
|
||||
|
||||
@@ -13,17 +12,21 @@ class Bot_info(commands.Cog):
|
||||
async def on_ready(self):
|
||||
logging.info(f'Cog {__name__.split(".")[1]} is ready!.')
|
||||
|
||||
@slash_command(name="info_bot") # this is for making a command
|
||||
async def info_bot(self, ctx):
|
||||
@commands.slash_command(name="info_bot") # this is for making a command
|
||||
async def info_bot(self, inter):
|
||||
# await ctx.send(f'Pong! {round(self.bot.latency * 1000)}')
|
||||
emb = discord.Embed(
|
||||
emb = disnake.Embed(
|
||||
title=f"General information",
|
||||
description=f"General information on about bot",
|
||||
)
|
||||
# emb.set_thumbnail(self.bot.avatar.url)
|
||||
emb.add_field(name="Bot ping", value=f'Bot ping: {round(self.bot.latency * 1000)}', inline=True)
|
||||
emb.set_footer(text="Information requested by: {}".format(ctx.author.display_name))
|
||||
emb.set_footer(text="Information requested by: {}".format(inter.author.display_name))
|
||||
|
||||
await inter.response.send_message(embed=emb, ephemeral=True)
|
||||
|
||||
|
||||
|
||||
await ctx.reply(embed=emb, ephemeral=True)
|
||||
|
||||
|
||||
def setup(bot): # an extension must have a setup function
|
||||
|
||||
Reference in New Issue
Block a user