Make bot suitable for multiple servers#67
Conversation
5797424 to
a67b876
Compare
|
Currently known bug: The bot has to be fully restarted in order to use the live and roles channel in a server it has been added during runtime |
Adapt feature checker to database Adapt codebase to database
… a problem anymore See #68
Ask to authorize user whenever /permit command is used
| ## Deployment and contribution | ||
| ### Requirements |
There was a problem hiding this comment.
Add docker deployment explanation
… JSDoc for command permissions
|
Edge case: If a user types |
|
Refresh tokens sometimes do not get stored and the whole permission system doesn't seem to work as the restricted commands don't get any custom roles that are permitted to execute them |
| streamers: [], | ||
| refreshToken: '', | ||
| }).catch(console.error); | ||
| } else this.warning(`Limited features due to problems ${guildInfo}`); |
There was a problem hiding this comment.
Remove a guild from the safe guilds if there was a problem to make this function safe when re-executing
| ); | ||
| } finally { | ||
| if (!error) { | ||
| DiscordClient._safeGuilds.push(guild); |
There was a problem hiding this comment.
Check if safe guilds doesn't already have this guild to make this function safe when re-executing
| * @param data The data to insert or update | ||
| */ | ||
| protected async upsert(tableName: string, data: T): Promise<void> { | ||
| const id = data.id; |
There was a problem hiding this comment.
| const id = data.id; | |
| const { id } = data; |
| if (i !== -1) { | ||
| this.#cache[i].info = data; | ||
| } else { | ||
| this.#cache.push({ id, info: data }); | ||
| } |
There was a problem hiding this comment.
| if (i !== -1) { | |
| this.#cache[i].info = data; | |
| } else { | |
| this.#cache.push({ id, info: data }); | |
| } | |
| if (i !== -1) | |
| this.#cache[i].info = data; | |
| else | |
| this.#cache.push({ id, info: data }); |
| @@ -1,5 +1,16 @@ | |||
| # Trojaner Bot | |||
| This is a [Discord](https://discord.com) bot currently only running on my [Discord server](https://discord.gg/NdsmmwV). There is no official way of adding this bot to your own Discord server. | |||
| This is a [Discord](https://discord.com) bot currently only running on my [Discord server](https://discord.gg/NdsmmwV). To add this bot on your server, use the following link: | |||
There was a problem hiding this comment.
| This is a [Discord](https://discord.com) bot currently only running on my [Discord server](https://discord.gg/NdsmmwV). To add this bot on your server, use the following link: | |
| This is a [Discord](https://discord.com) bot currently only running on my [Discord server](https://discord.gg/NdsmmwV). To add this bot on your server, follow these steps: |
| ## Adding the bot to your server | ||
| 1. Click the following link: https://discord.com/api/oauth2/authorize?client_id=632637013475983360&permissions=8&scope=bot%20applications.commands | ||
| - Note that the bot is added with admin privileges. You may alter the permissions value but keep in mind that some features might not work or lead to unexpected behavior | ||
| 2. (Optional, can be done later) Set up the following text-channels |
There was a problem hiding this comment.
| 2. (Optional, can be done later) Set up the following text-channels | |
| 2. (Optional, can be done later) Set up the following text-channels: |
/permitcommand if required)