Send a message to multiple chat ID in telegram group using python - python-3.x

Currently I'm working with my telegram python script and I want to modify it so I can send message to multiple chat id or telegram group using python script, as of now my script is working but can only read 1 chat id, can someone help me what I need to modify with my script? Thank you
My script
botToken = "somebot:ID"
chat_id = "someChatID1234"
Send data to telegram
print(files)
url='https://api.telegram.org/botsomeboy:ID/sendMessage?chat_id="&text="{}"'.format(files)

Try this module :
python-telegram-bot

Related

Create private text channel inside of guild using discord.py bot command

im having trouble finding a way to create a private text channel using discord.py. right now i have the bot able to create public text channels that every guild member is able to view and message in. ive looked at the readthedocs for the library and cant seem to find any answer.
here is the code for the command im using right now:
if message.content == '!create':
user = (message.author)
await message.guild.create_text_channel(f"{user} - channel")
tried various commands and expected discord bot to create private text channel using discord.py.

How I can create a log channel for my discord bot and how I can get records on the log channel?

I have some disсord servers and I need the bot to create a log channel into which my bot is able to write the data I will indicate in the code.
If you search on discord.py docs you would find this from guild's object.
await create_text_channel(name, *, overwrites=None, category=None, reason=None, **options)
Example:
guild = client.get_guild(ID)
await guild.create_text_channel('logs')
If you want the bot for everyone to use, you would need a database to save channels' id.
About the type of logs that you want to send to each guild it really depends. If it is only logs that you write by your own then just loop all channel's id that you saved and send each one a message.
If it is some discord logs given by discord API then you would have to search in discord.py docs for more info.

How to send an automated message to a skype group chat using python

Even though i am able to send messages to an individual skype contact using skpy module. i am unable to send to a group chat.
Below is the simple code i've used to send:
from skpy import Skype
sk = Skype("myskypeID", "pwd") # connect to Skype
content="the message i wanna send"
ch = sk.contacts["SkypeID_in_contacts"].chat
ch.sendMsg(content)
I cannot find any skype group ID for my group chats. Is there anyway of finding a skype group ID or some other method to append with python code i have used.
Please help
All Group Chart in Skype have an ID like
19:<random>#thread.skype
Here you can find a simple script to found all your groups IDs
How to get Skype Group Chat ID
End then you can found your chat with that id
ch = sk.chats["19:0b85483d2d634415993bb9daf58e7891#thread.skype"]
ch.sendMsg(msg)

how can I ask my telegram bot user to share his contacts with bot?

how can I ask my telegram bot user to share his contacts with bot ?
any inline keys or commands?
I want the output to be contacts chat id
$keyboard = json_encode([
'resize_keyboard'=>true,
'keyboard'=>[
[['text'=>"request contact",'request_contact'=>true]]
]
]);
there is a way to get contact of bot user (not user`s contact) with KeyboardButton (request_contact=True)
(is used it in python-telegram-bot v13.13 library)
you can read more in
telegram core bots KeyboardButton

How do I send a direct message to someone when they join a server with discord.py

I'm writing a bot for my discord server and I want to send an automatic direct message to anyone who joins the server for the first time. I have looked through the documentation and I can't find anything about how to do this. I am using python 3.5 and discord.py version 0.16.12.
this should work if you are using the discord py rewrite
make sure you have enabled intents for the bot as shown in this picture
intents=discord.Intents.all()
client = commands.Bot(command_prefix= cmd,intents=intents)
#client.event
async def on_member_join(member):
await member.send(f"your welcome message here")
https://discordpy.readthedocs.io/en/latest/api.html#discord.on_member_join
You can do something along the lines of:
await bot.send_message(member, "hello")

Resources