I need to send requests from my website to Midjourney on Discord. The user will attach a photo and text with information about the image he wants to get. Then this information needs to be sent to midjourney in discord. After midjourney generates the image, it must be sent back to the website. How can I do this? I couldn't find a way to send the command /imagine to midjourney with python. Is this even possible?
Yes, it is, and by the way, this is a duplicate of my question I think...
anyway try this https://github.com/Wildric-Auric/MidJourney-Wrapper
It's a wrapper, it is a bot that can call the /imagine command, I'm currently having problems with it on my other questions in StackOverflow.
you can add functionality to it and make it send its commands automatically
Related
I need a telegram bot that sends you inline button with some information bellow and when you press that button, it sends information (not an URL or something) I need a message with an image for example, when I search for tutorials it only shows me to put URLs, if someone can help me I would be so gratefull
A quick search reveals that you are searching for a keyboard and if you look into the python-telegram-bot library, you can find examples like inlinekeyboard2.py. Once you understand how it works, you can move on to sending a message. I suggest you take a look at the resources section in the same library, since you tagged python.
If you try this and fail at a clear definable problem, then you might ask a question here (in a new thread), so that you can get an exact solution.
I've tried reading through the documentation but I'm new to python and don't understand a thing. I'd like my bot to send a message when a user gets mention. For example, when I get mentioned, the bot will respond response A etc. Any thoughts? TIA.
Is there a way to fetch URL when a certain channel goes live in python?
It's a bit more complicated than that. You actually some steps to do for this kinds of programs.
You should create a bot (web scraper) that get's the data in a certain channel.
Then put this bot on a server to run it constantly
The this bot should notify you after changes in live stream of that channel and as an option it gives you the URL (by email or SMS).
P.S. I did some search for APIs but nothing found related to your question but this and this might be helpful.
I've started tinkering with python recently and I'm on my way to create my very first telegram bot mainly for managing my Raspberry Pi and a few things connected to it. The bot is done but I would like to send a message to all the users that have already interacted with the bot when it starts, basically saying something like "I'm ready!", but I haven't been able to find any information about it.
Is there any specific method in the API already done to do this? Or should I create another file to store the chat_id from all the users and read it with python?
Thank you all for your help!! Regards!
You should have a Database that stores Chat-id(s) of Clients that interact with your bot.
If you're able to put them into a list, then the job is half done.
All you need to do is to create a "for loop", and send message to all the ID(s) in the list.
Example:
message = "Good morning"
chats =[1234447488,3748838477,4748848578,7463638488]
for chat in chats:
bot.send_message(chat_id=chat,text= "message")
In case of of clients that have deleted your bot, you may experience an error. You can catch that with try and except.
Is there any specific method in the API already done to do this?
No, there's no such method.
Or should I create another file to store the chat_id from all the users and read it with python?
Yes, you should handle it yourself. Usually user ids and another information about User <-> Bot interaction is stored in a database on a server, because it's easier for maintaining and searching.
So if you want to send a plain text message to your users in a file, you should call SendMessage method of telegram bot API for every user in your file.
You should save users in database or file.After that use for to send_message one by one to all users that you have in database or file.
Yes you should create another file or use a database to store the chat_id of all the users you interact with. You can check Telegram Bots API to see all the available commands. if there is no such command then there probably won't be any command in the wrapper you are using for python either.
Hi everyone so I’m new to developing bots for Telegram with Python and I need help being able to generate the basic get updates information. I usually can when I use the web browser, you know when you drop the telegram link with the bot token key and finish it up with the GetUpdate function in the address bar then the browser just generates a page with all the info such as chat_id, user_id, firstname,last name, etc. Yeah I want to know how to do that with Python so I can achieve the same results in the python terminal. I’m working with the telegram bot for python package so I think it’s called telegram.ext. I’m using the basic guide which involves me using the Dispatcher and Updater, I’m still learning from the guide but for now I need to know how to get that system/session info using my bot in the python terminal. Feel free to ask any questions to clarify this question, thanks.
So far I the most I can do is print out messages I’ve sent to the bot but that’s about it, it’s pretty much filtered and I don’t want that I want the raw and unorganized information like browser usually provides.
The easiest way is to use requests library:
import requests
r = requests.get('https://api.telegram.org/bot<BOT_TOKEN>/getupdates')
print(r.json())