I’ve been working on a telegram bot and I just managed to design it to handle commands and issue responses to users.
I was able to achieve this successfully and started testing each and every command repeatedly to ensure they work, mind you these are like 6 or 7 commands. Basically user sends the /command and my bot sends feedback and that for like the very first few tries, like it really worked then suddenly it all stopped working.
The welcome message for new group users from the bot the feature still works but the commands aren’t.
I didn’t register all commands with BotFather but they worked anyway regardless so I’m not sure that’s the problem.
Related
I've been hosting a discord bot on an online IDE but it happens to disconnect from the API after a while. The code on the IDE continues to run, but on discord, it is unable to respond to commands and essentially the entire bot is completely offline, while a running code is being executed. Even more suprising is a background task that I have assigned to run every minute continues to do it's job ( which is to edit a embed in a server with new information ). I've been going through the documentation and about the gateway kinda stuff but I'm utterly confused. It states that disconnections are regular but never teaches me how to actually connect again rather some snippets of JSON data. Documentation here : https://discord.com/developers/docs/topics/gateway#gateway-intents
I'm a bit new to this stuff but the documentation clearly doesn't talk anything about the way to connect to the gateway, and what to do during a op7 reconnect. How would I be able to incorperate this reconnection thing with my discord bot also?
how can I run the telegram auto message bot when I turn off my computer with the API I made with python?
Otherwise, it exits the terminal and the bot closes automatically.
Are you asking why when your computer turns off, and the python file stops running, the bot no longer functions?
You would need to have either a server or another device to run it then, should you wish to turn your computer off
I'm not sure if I misunderstood this or not.
My bot was giving me two outputs or more every time I gave it a command (for example, I said .ping and said the bot's ping twice). I figured out that the problem was the bot was running somewhere else, so I regenerated the token and everything worked fine for a little while until the problem started happening again. I kept regenerating the token and it fixed the problem for a bit. Is there a way I can find where else my bot is running and shut it down there?
If you want to close all running instances of the bot, just use exit().
#commands.is_owner() #make sure no one else uses it
#bot.command()
async def stop_bot(ctx):
exit()
This will close all the instances of the bot.
I am trying to make a bot that sends out updates for a game to interested servers. These updates would be manually sent out by me through terminal (or something else). Users would invite the bot and select what channel they want updates to be sent out to (if it would be easier to make every server use the same channel I would be good with that). Hopefully this is something simple enough to make.
EDIT 1:
I have searched a little and could not find much. However I am now more clear knowing what it should do. Instead of terminal it will grab stuff from a rss feed and to avoid using a database the channels names in all the severs will be the same. No commands will be needed.
Im working on porting a Twitch bot to Discord, and I want to have the bot send a message if the owner of the Discord server is streaming. I haven't tried anything yet, but i had the idea of doing something like:
if server.owner.game.type == 1:
await chat(channel, message)
All I need to know now, is how to put this in a different thread, or do something so that this checks ever few seconds or minutes, and can send the message.
also i cant seem to get the code to show up as code :/