I am trying to make a discord bot in which I want that as soon as user type into command channel his/her discord id must be printed

Advertisements if message.content.startswith(‘$register’): await message.channel.send(‘You are registered successfully’) userk = print(client.user.id) I am using Discord.py and Iam trying to get the Discord user id of a user when they type into a channel. But I am not able to find the specific command for that current api of discord is not saying anything about that.the… Read More I am trying to make a discord bot in which I want that as soon as user type into command channel his/her discord id must be printed

Yes or no question with python on discord

Advertisements I’m trying to make a Discord bot which can ask a yes-or-no question and respond to the user’s answer. I tried this code: @bot.event async def on_message(message): if message.content == ‘ask me a question’: await message.channel.send(‘Yes or No’) if message.content == ‘yes’: await message.channel.send(‘correct!’) elif message.content == ‘no’: await message.channel.send(‘wrong’) The bot responds to… Read More Yes or no question with python on discord

how to sent request to discord bot api?

Advertisements How do I properly send a discord API request, and where do I get a valid token to do that because my discord bot token did not work there ? async function APIrequest(){ const lib = require(‘lib’)({token: ‘wich api key?’}); let result = await lib.discord.channels[‘@0.3.2’].retrieve({ channel_id: channelid }); console.log("result") console.log(result) } >Solution : I… Read More how to sent request to discord bot api?

How can I remove a specific role from everyone that has it in Discord.js v13

Advertisements I want my bot to remove a specific role from everyone that has it when a message is sent in a channel client.on(‘messageCreate’, async message => { if(message.channel.id === ‘954375143965216869’){ //counting message.guild.roles.get(‘944674567811645472′).members.map(m=>m.member.id).delete(); } }) I’m using discord.js v13 and node.js v16.4.2 >Solution : This should work, it’ll fetch all the members in the guild… Read More How can I remove a specific role from everyone that has it in Discord.js v13