Skip to content

Commit

Permalink
fix(bot): fixed message content intent
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Sep 10, 2022
1 parent 8a23047 commit c8b2f22
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions core/components/ConfigVault.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default class ConfigVault {
enabled: toDefault(cfg.discordBot.enabled, null),
token: toDefault(cfg.discordBot.token, null),
announceChannel: toDefault(cfg.discordBot.announceChannel, null),
prefix: toDefault(cfg.discordBot.prefix, '/'),
prefix: toDefault(cfg.discordBot.prefix, '!'),
statusMessage: toDefault(
cfg.discordBot.statusMessage,
'**IP:** `change-me:<port>`\n**Players:** <players>\n**Uptime:** <uptime>',
Expand Down Expand Up @@ -222,7 +222,7 @@ export default class ConfigVault {

//DiscordBot
cfg.discordBot.enabled = (cfg.discordBot.enabled === 'true' || cfg.discordBot.enabled === true);
cfg.discordBot.prefix = cfg.discordBot.prefix || '/';
cfg.discordBot.prefix = cfg.discordBot.prefix || '!';
cfg.discordBot.statusMessage = cfg.discordBot.statusMessage || '**Join:** `change-me:<port>`\n**Players:** <players>\n**Uptime:** <uptime>';
cfg.discordBot.commandCooldown = parseInt(cfg.discordBot.commandCooldown) || 30; //not in template

Expand Down
9 changes: 7 additions & 2 deletions core/components/DiscordBot/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const modulename = 'DiscordBot';
import Discord from '@citizenfx/discord.js'
import Discord, { Intents } from '@citizenfx/discord.js'
import logger from '@core/extras/console.js';
import { verbose } from '@core/globalData.js';
import commands from './commands';
Expand Down Expand Up @@ -96,8 +96,13 @@ export default class DiscordBot {
}

//Setup client
const clientIntents = new Intents([
Discord.Intents.FLAGS.GUILDS,
Discord.Intents.FLAGS.GUILD_MESSAGES,
]);
clientIntents.add(15); //equivalent to MESSAGE_CONTENT, but our client is outdated.
this.client = new Discord.Client({
intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES],
intents: clientIntents,
autoReconnect: true,
});

Expand Down
12 changes: 4 additions & 8 deletions docs/dev_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ v4.18.0:
- [x] fix HealthMonitor resource boot time limit
- [x] prevent external modifications of admins.json
- [x] update some packages

somehow backup the stashes
add newDatabase to the docs folder (don't i have it anywhere else?!)
re-clone folder
merge dev into master, try to release rc again
pagar contas
check discord intent
- [x] create beta release action
- [x] temp disable process info
- [x] fix perf chart labels (closes #661)
- [x] fix discord message intent

Optional:
- [ ] fix cfx.re login match by admin id
Expand All @@ -22,7 +19,6 @@ Optional:
- [ ] stats: add recipe name + if ptero + random collisions + how many scheduled restart times + drop zap/discord as login methods
- [ ] stats: jwe
- [ ] playerlist remove rtl characters
- [ ] create beta release action
- [ ] set nui/vite.config.ts > target > chrome103

The Big Things before ts+react rewrite:
Expand Down

0 comments on commit c8b2f22

Please sign in to comment.