Read messages in a discord channel without running client - discord

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?

Related

Discord.net Send A Slash Command With Bot

I'm trying to have my bot simply send a slash command to a specific discord channel. The command would be read by another bot and executed as needed. Is this possible? I'm using discord.net. I have my bot sending plain text messages to the channel with the code below.
await ((ISocketMessageChannel)_client.GetChannel(channelId)).SendMessageAsync("Just Text Here", false, eb.Build());
I'm trying to send the command below. The bot that should respond is noted here. (https://www.alphabotsystem.com/guide/charting).
/c aapl 3m macd mfi
I checked the documentation + newest version methods and I'm afraid there is no such functionality.
In addition developers very often secure their bots by adding a condition which ignores executing commands from Webhooks and Bots.

Message counting in discord.js?

So i want to do a command, where if you enter, it sends a Dino emoji and a "sent by (User)" in a specific channel.
Now i need to know, is it possible to count every message in this channel and put it in the dino message?
Like the first dino ever would get
"dino #1, sent by #User"
I would not recommend using the number of messages in the channel for counting. Instead I would use some kind of data storage (JSON file, SQLite, SQL Database, etc) to store the count on the bot side. Fetching all the messages in a channel is a lot of requests to Discord and in some cases could be considered API abuse on Discord's end.

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

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

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 bot to check if a minecraft server is online

I was wondering if anyone knew of a discord bot that will send a message in a discord sever when a minecraft server is online and send a message when it goes back offline
I've done some googling and can't seem to find one that does what I want there are a couple that u have to manually type commands for and others that appear in the sidebar of discord I simply want one that will do it automatically is there one that exists like this already?
I didn't found any not that already did this, but you can do this pretty easily with the Discord API.
Here is a a script I found that send a message to the server : https://gist.github.com/ianklatzco/769d9e3a991dc2f443a2e105b0157117
You can adapt it to ping the server in a if statement to send if it is online or not
(This script is in python but the Discord api works in more languages)

Resources