New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Many improvements and changes #85
base: rewrite-slash
Are you sure you want to change the base?
Conversation
|
||
# The Twitch username to use if activity type is "streaming" | ||
# DISCORD_STATUS_URL = TTVUserName (Uncomment to use it) | ||
# The URL to a Twtich/YouTube stream if DISCORD_ACTIVITY_TYPE is set to streaming. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Twtich -> Twitch
location_name = interaction.guild.name if interaction.guild else "Private message" | ||
print( | ||
f"{location_name} > {interaction.user} > {interaction.command.qualified_name} (arguments: {vars(interaction.namespace)})" | ||
) | ||
|
||
@commands.Cog.listener() | ||
async def on_ready(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing any of this in on_ready really sets a bad example. This needs to go in setup_hook.
) | ||
|
||
await self.bot.change_presence(status=from_status_type[status_type], activity=activity) | ||
|
||
global_synced = await self.bot.tree.sync() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Syncing app commands on startup is also not needed. This is especially bad in on_ready as it can be fired multiple times. Do not sync in on_ready.
I have significantly improved the codebase with main changes being the following:
ctx
tointeraction
like how its supposed to beDISCORD_GUILD_ID
config var toOWNER_GUILD_ID
and is actually used on all commands incogs/admin.py
and when syncingreload, load, unload, reloadall
into one command with choices calledextensions
/change avatar
120
amiadmin
command tocogs/fun.py
since that isn't supposed be owner-onlyNothing was tested