How do i make a bot that responds to one specific user? Discord.py
You could simply just check if the user's id is same from your code. Below is an on_message
that checks if the author of the message has the user id of xxx
make sure to set it yourself. This would always trigger the event whenever a message has been sent, but only send the message if the user id matches
@client.event
async def on_message(message):
if message.author.id == 000000000000:
await message.channel.send('Hello')
Next time it's best if you show an example of what you have tried, so we can fix or show examples of your code.
DiscortJS bot send a message back on the channel mentioning a specific user
I think mention
is an array of users. So you can do:
for (const user of mention) {
message.channel.send('YUB NUB!! YUB NUB!! Grrrrr!! @' + user.username)
}
I want my discord bot to respond if a specific message is coming from a specific user
Make sure to add this at the very end
*await client.process_commands(message)*
Example:
@client.event
async def on_message(message):
if message.author == client.user:
return
if client.user.mentioned_in(message):
await message.channel.send("hey!")
await client.process_commands(message)
How do i send a message in a specific channel when my bot start
Instead of using client.getchannel which doesn't exist, use Client.get_channel
. It returns a channel which can be used to send messages.
Example:
channel = client.get_channel(id)
await channel.send("hi i've started")
how to make a discord bot mention someone in a specific channel (discord.js)
Well first you would need to get the channel somehow, maybe by id:
const endChannel = message.guild.channels.cache.get(id);
After that you can just use the send method alongside msg.author
endChannel.send(`${message.author} here's the ending`, { embed: B3ending });
Related Topics
How to Disable and Enable a Click Event on a Table Td
How to Synchronize the Scroll Position of Two Divs
Property Does Not Exist on Type 'Never' Typescript/React
How to Get the Contextpath from Javascript, the Right Way
Updating Array in Object Properties Using Property'S Name
How to Get Values of Checkbox in Node Js Using Ejs
Uploading Multiple Files Using Formdata()
Count the Number of Times a Same Value Appears in a JavaScript Array
Setting the Value of a Checkbox Input If Not Checked
Increase JavaScript Heap Size in Create-React-App Project
Django Template JavaScript Passing a Python Variable to a JavaScript One
How to Find If a Text Contains Url String
How to Import Modules from All Files in a Directory, Using a Wildcard
How to Redirect Url After Login Successful Via Ajax Call in PHP
Get Request Works With Postman But Why Doesn't It Work With Reactjs Fetch
Javascript Validation: Block Special Characters
How to Combine Object Values from Separate Lines into One Line
React Js - Uncaught Typeerror: This.Props.Data.Map Is Not a Function