-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
ChangeA modification to something that existsA modification to something that exists
Description
Current Behaviour
Problems, Frustrations, General Description
Currently, when we want 'global' access variables, we tend to assign them to the bot's Client object. This is bad for several reasons such as if Discord ever change how Client is passed around or freeze it from having non-Discord props/methods attached.
Since it's been agreed on by several staff members, I'd also like to play around with the idea of slowly converting ViBot to TypeScript, having these random properties littered into the type makes it exponentially more annoying and possibly impossible how it's currently implemented as JS.
It's just better style overall to keep these properties contained in their related modules and have them required/imported from them instead of pseudo-global.
Tasks
Things to Do
- Move
bot.commands&loadCommandsinto acommands.js#746 - Move
bot.afkChecks&bot.afkModulesintoafkChecks.js - Move
bot.settings,bot.settingsTimestamp& move initializing logic into asettings.js#752 - Move
bot.adminUsersintosettings.json - Move
bot.storedEmojis,bot.emojiServers&commands/emoji.js'supdatefunction into a broaderemoji.jsoutside ofcommandsfolder - Move
bot.devServersintosettings.json - Remove
bot.dbsin favor ofgetDBfromdbSetup.js - Confirm if there are any other currently unidentified ViBot properties.
- For
settings.rolesandsettings.channels, map properties to roles instead of being string ids- This is meant to reduce code where the vast majority of the uses of these properties are immediately passed into a
guild.channels.cache.get(settings.channels.xyz)etc.
- This is meant to reduce code where the vast majority of the uses of these properties are immediately passed into a
- Preferably, I'd like to keep 'globally' used properties outside of the
commandsfolder; where possible, do so.
Metadata
Metadata
Assignees
Labels
ChangeA modification to something that existsA modification to something that exists