What's new
Runion

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Discord bot and telegram bot

Bella

Midle Weight
Депозит
$0
Please i need a recommendation of a bot or how to make a bot or who makes a bot
That can send mass dm in discord and telegram

All recommendations are appreciated
 
Here is an example of a bot that sending messages to users in a telegram with phyton


Python:
Скопировать в буфер обмена
import telegram

bot = telegram.Bot(token='YOUR_TOKEN')
user_ids = ['123456', '7891011', '12131415']

for user_id in user_ids:
try:
bot.send_message(chat_id=user_id, text="Hello, I'm your bot!")
print(f"Message sent to user {user_id}")
except Exception as e:
print(f"Error sending message to user {user_id}: {e}")
 
As another solution you can use something like TDLib to make a robotic client.
I prefer Kotlin, so made a small example with this lib https://github.com/KurenaiRyu/tdlight-sdk (This is just for example of using similar clients, not my recommendation)


Код:
Скопировать в буфер обмена
import io.github.kurenairyu.tdlight.Client
import io.github.kurenairyu.tdlight.exception.ClientException
import io.github.kurenairyu.tdlight.handler.UpdateHandler
import io.github.kurenairyu.tdlight.util.ResultHandler
import io.github.kurenairyu.tdlight.util.TelegramObject
import io.github.kurenairyu.tdlight.util.TdApi

class Bot(token: String = "YOUR_TOKEN") {

private val client = Client.create(token)

fun init() {
client.start()
}

fun sendDirectMessagesToFriends(message: String) {
client.send(TdApi.GetContacts(), object : ResultHandler {
override fun onResult(obj: TelegramObject) {
if (obj is TdApi.Users) {
obj.users.filterIsInstance<TdApi.User>().forEach { user ->
if (user.type.constructor == TdApi.UserTypeBot.CONSTRUCTOR) {
//Ignore bots
return@forEach
}
client.send(TdApi.SendMessage(user.id, 0, false, false, null, TdApi.InputMessageText(TdApi.FormattedText(message, null), false, true)))
}
}
}
})
}
}
 
Bella сказал(а):
Please i need a recommendation of a bot or how to make a bot or who makes a bot
That can send mass dm in discord and telegram

All recommendations are appreciated

PM
 
Top