Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

My Discord bot is not responding to messages/not even outputting to terminal?

Trying to make a sorta complicated bot, but before i get started on writing the other code I wanted to just make sure that the bot worked in Discord, and was up and running and responding to a basic command – Send the message "Hello" when someone used the command "!hello".

import discord
from discord.ext import commands

intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix='!', intents=intents)
TOKEN = "TOKEN"

@bot.event
async def on_ready():
    print(f'Bot connected as {bot.user}')


@bot.command(name='hello')
async def dosomething(ctx):
    print(f'Hello command made')
    await ctx.send("Hello!")

  bot.run(TOKEN)

the on_ready function does work, it outputs the name of the bot whenever it connects, but trying to get it to respond to a simple !hello command does nothing, it doesnt message in the channel and it doesn’t print to console. Here’s my permissions for the bot as well from Discord Developer Portal – https://imgur.com/a/xrcH1tw

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Try adding this at the line above commands.Bot

intents.message_content = True
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading