discord selfbot send the same message to different channels in different servers - discord

I'm trying to create a macro that sends a message to different channels in different servers every 8h but I can't figure out how to make it send a msg in a channel automatic (I'm trying to send the msg as soon as I run the py file) I have been searching for different example in the discord.py documentation but all the examples I found send a msg after a command) but I just want to know how do I make a discord selfbot send a message that has multiple lines to a channel and then I believe I can make it myself.

I know this should just be a comment but for the sake of making sure people will see this, I'm also posting it as an answer.:
Self-bots are 100% against the Terms of Service of the Discord API, you can have your account deleted for using one. https://support.discord.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-

Put this in your code
import time
#client.event
async def on_message(message):
await message.channel.send('Text Here')
time.sleep(28800)
and selfbots are against the tos and you can get your account deleted

Related

how to send automatically a message when we send in a Discord channel

In a Discord server I manage, there is a channel "Tutorials", where people can share tutorials for tools they might find useful.
The "rule" of this channel is that if we have a question about a tutorial, we need to answer inside a thread and not in the channel discussion (to avoid the important message being lost in history).
I updated the description of the channel, but this is not enough, because not everybody read it ;)
So I would like to set a way to make the user sure before they publish their message, for instance, my idea is when they try to send a message to the channel, a hidden message pops up telling "are you sure you want to do this ?" to recall the rule to the user.
Is there such a feature in Discord (or with a bot) ? Until now my researches were unsuccessful.

How do I create a stickied message in Discord.js

I've looked all over and I can't find a solution.
I'm using discord js using non-slash commands.
How could I make it so you have a message from the bot and if someone types in the channel the bot's message will get deleted and resent
I want to do this in a sense of a server request channel so you need to add the channel you want the command to run and what you want it to say:
e.g:
Stickied Message
Name:
Request Needed:
Approved By:
how could I program that? Thanks :) <3
I ahve googled online and can't see anything relating to this topic - maybe I'm not searching the right things?
Tried Discord.js V13 | Sticky Message but did not work

Read messages in a discord channel without running client

Is there a way to read the messages on a discord channel using discord.py without running the client? The use case is, I have a lambda function that runs slash commands so that I don't have to have a permanent machine listening. This works fine. I want to make a slash command to read all the messages in the channel and save the attachments in the messages in the channel. All the examples I have seen are to make text bots declaring the commands and end with:
client.run('your-token-here')
Which means it needs to be constantly up. Is this possible?

Is it possible to show by command how many voice channels my Discord bot is currently connected to?

I would like to display via command how many voice channels my bot is currently in, is this possible? Maybe also with extra things like the server ID/channel ID. This is not needed though, just the command and the amount would be good.
I already found a method for js but not for Discord.py.
You can use the Bot.voice_clients attribute
voice_states = bot.voice_clients # or client, however you named your instance
await ctx.send(f'I am currently in {len(voice_states)} voice channels')

Discord js send everyone pm

I want send everyone in server a message or a embed.
I searching google nothing shows up .
I Saw some bots doing anonuncements. PM everyone.
How i can do that . I want a working example i was using discord js .
The most effective way to do this would be to make an announcement channel and get the bot to "#everyone".
If you want to DM everyone in the server, loop through a servers members list and DM each user individually; remember that Discord limits 5 messages per every 5 seconds, so put a delay in your loop.
Discord Api got limits There are limitations with bot DMs, which you can read at https://discordapp.com/developers/docs/topics/rate-limits
Better to mention everyone or role.
This is not recommended, as the Discord API has limits. On the other hand, sending multiple direct messages to users will cause your bot to get blacklisted from "Possible Spam".
Still, you can achieve this as follows:
// Assuming 'guild' is the Server Guild
guild.members.cache.each(member => {
// Send message
member.user.send('An amazing message!').catch(e => {
// An error has occurred
console.log(e);
});
});
It is possible to go loop through and DM all of the users. However, with the Discord API having limitations this can be more tricky with a large server and you are going to want to implement a sleep function.
Use the code:
guild.members.cache.forEach(m => {
m.user.send('Hello this is a dm!')
})
As Morgan said it is probably easier to simply create a channel and just #everyone
Discord prohibits you from mass dming users.
and you will get rate limited

Resources