Discord.js: Invalid bitfield flag or number: GUILDS

In discord.js v14, intent flags are available from GatewayIntentBits. const { Client, GatewayIntentBits } = require(‘discord.js’); const client = new Discord.Client({ intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, ] }) List of changes: v12/v13 v14 GUILDS GatewayIntentBits.Guilds GUILD_BANS GatewayIntentBits.GuildBans GUILD_EMOJIS_AND_STICKERS GatewayIntentBits.GuildEmojisAndStickers GUILD_INTEGRATIONS GatewayIntentBits.GuildIntegrations GUILD_INVITES GatewayIntentBits.GuildInvites GUILD_MEMBERS GatewayIntentBits.GuildMembers GUILD_MESSAGE_REACTIONS GatewayIntentBits.GuildMessageReactions GUILD_MESSAGE_TYPING GatewayIntentBits.GuildMessageTyping GUILD_MESSAGES GatewayIntentBits.GuildMessages GUILD_PRESENCES GatewayIntentBits.GuildPresences GUILD_SCHEDULED_EVENTS GatewayIntentBits.GuildScheduledEvents GUILD_VOICE_STATES … Read more

Checking if a message was sent from a DM channel type not working

Are you sure you haven’t updated your discord.js version and you’re still using v12? Channel types in v13 are now uppercase and align with Discord’s naming conventions. See below the changes: channel type v12 v13 DM channel dm DM group DM channel N/A GROUP_DM guild text channel text GUILD_TEXT guild text channel’s public thread channel … Read more

“RuntimeWarning: coroutine ‘BotBase.load_extension’ was never awaited” after updating discord.py

Explanation As of discord.py version 2.0, Bot.load_extension is now a coroutine and has to be awaited. This is to allow Cog subclasses to override cog_unload with a coroutine. Code await must be used in front of client.load_extension, as shown: await client.load_extension(“your_extension”) In each of your cogs: Replace the standard setup function with an asynchronous one: … Read more

setPresence activity type in discord.js v14 can only be set to “PLAYING”

In v14, you will need to use the ActivityType enums or numbers. You can import it from discord.js: const { Client, GatewayIntentBits, ActivityType } = require(‘discord.js’); And use it like this: client.user.setPresence({ activities: [{ name: `discord.js v14`, type: ActivityType.Watching }], status: ‘dnd’, }); List of ActivityTypes: v13 v14 v14 value “COMPETING” ActivityType.Competing 5 “CUSTOM” ActivityType.Custom … Read more

How can I send an embed via my Discord bot, w/python?

To get it to work I changed your send_message line to await message.channel.send(embed=embed) Here is a full example bit of code to show how it all fits: @client.event async def on_message(message): if message.content.startswith(‘!hello’): embedVar = discord.Embed(title=”Title”, description=”Desc”, color=0x00ff00) embedVar.add_field(name=”Field1″, value=”hi”, inline=False) embedVar.add_field(name=”Field2″, value=”hi2″, inline=False) await message.channel.send(embed=embedVar) I used the discord.py docs to help find this. … Read more

AttributeError: ‘Client’ object has no attribute ‘send_message’ (Discord Bot)

You are probably running the rewrite version of discord.py, since the discord.Client object does not a have a send_message method. To fix your problem you can just have it as: async def test(author, message): await message.channel.send(‘I heard you! {0.name}’.format(author)) but for what i see you doing I reccomend using the commands extension This makes creating … Read more