load_extension updated

This commit is contained in:
SamSanai 2023-01-03 13:16:37 +00:00
parent 5049644ace
commit 7b213af416
2 changed files with 11 additions and 11 deletions

View File

@ -76,7 +76,7 @@ class voice(commands.Cog):
@commands.command()
async def help(self, ctx):
embed = discord.Embed(title="Help", description="",color=0x7289da)
embed.set_author(name=f"{ctx.guild.me.display_name}",url="https://discordbots.org/bot/472911936951156740", icon_url=f"{ctx.guild.me.avatar_url}")
embed.set_author(name=f"{ctx.guild.me.display_name}",url="https://discordbots.org/bot/472911936951156740", icon_url=f"{ctx.guild.me.display_avatar.url}")
embed.add_field(name=f'**Commands**', value=f'**Lock your channel by using the following command:**\n\n`.voice lock`\n\n------------\n\n'
f'**Unlock your channel by using the following command:**\n\n`.voice unlock`\n\n------------\n\n'
f'**Change your channel name by using the following command:**\n\n`.voice name <name>`\n\n**Example:** `.voice name EU 5kd+`\n\n------------\n\n'
@ -304,5 +304,5 @@ class voice(commands.Cog):
conn.close()
def setup(bot):
bot.add_cog(voice(bot))
async def setup(bot):
await bot.add_cog(voice(bot))

View File

@ -15,14 +15,6 @@ DISCORD_TOKEN = 'Enter Discord Token here'
initial_extensions = ['cogs.voice']
if __name__ == '__main__':
for extension in initial_extensions:
try:
bot.load_extension(extension)
except Exception as e:
print(f'Failed to load extension {extension}.', file=sys.stderr)
traceback.print_exc()
@bot.event
async def on_ready():
print('Logged in as')
@ -30,4 +22,12 @@ async def on_ready():
print(bot.user.id)
print('------')
for extension in initial_extensions:
try:
await bot.load_extension(extension)
print(f'Loaded {extension}')
except Exception as e:
print(f'Failed to load extension {extension}.', file=sys.stderr)
traceback.print_exc()
bot.run(DISCORD_TOKEN)