bots

how to create a bot with in telegram with botfather and using only a code?

浪子不回头ぞ 提交于 2020-06-28 04:14:08
问题 There are some steps that has been mentioned in telegram api for creating a bot using a botfather. I was hoping if there is a way that these steps can turn into code. to be specific, i want to get a token from botfather using code and then later in the code i use this token. 回答1: Yes this is very possible. You would however need to build a Telegram Client, that will interact with BotFather. The interaction should be easy to script, as BotFather interaction follows just a few simple steps 来源:

How does bulkDelete work?

两盒软妹~` 提交于 2020-06-28 04:12:42
问题 I tried using bulkDelete to make my bot delete its message but I get this error: (node:5724) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Bad Request (node:5724) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. And here is my code: const Discord = require('discord.js'); const bot = new Discord.Client(); const config =

How does bulkDelete work?

佐手、 提交于 2020-06-28 04:12:23
问题 I tried using bulkDelete to make my bot delete its message but I get this error: (node:5724) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Bad Request (node:5724) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. And here is my code: const Discord = require('discord.js'); const bot = new Discord.Client(); const config =

Running Flask & a Discord bot in the same application

不想你离开。 提交于 2020-06-27 13:54:26
问题 I am building a Discord bot in Python and would like to receive HTTP requests from Twitch.tv's API (See Webhooks Guide & Webhooks Reference) (To subscribe to events like; X streamer has gone live) and based on the content of the HTTP (POST or GET) request received from Twitch, do something on the Discord bot, e.g: Output a message on a text channel. I am using the discord.py Python Discord API/Library. I've looked into the matter and found that Flask seemed like a good minimalist choice for a

telegram bot prefill text for user to edit

左心房为你撑大大i 提交于 2020-06-24 11:44:10
问题 Telegram bot sends me a message with a text snippet, which I want to edit, and send back to the bot for further processing. Copy and paste takes time. Typing message anew takes time. Ideally I'd like to press an inline button "Edit" on the bot's message and get the message text appear in my reply input box for editing.(A message id attached to my reply somehow would be a plus). I tried to use deep linking with parameters other than /start*, but that doesn't seem to work. Can I use bot API (or

Discord.py add role to user

 ̄綄美尐妖づ 提交于 2020-06-18 05:58:52
问题 I am new to python and creating discord bots in general and I can't for the life of me figure out how to make my bot assign a role to a user upon the users request. I have scoured the internet for hours on end and have found a few examples but they all produce and error. Here is the code I have for the command: @client.command(pass_context=True) @commands.has_role("Bots") async def add_bot(ctx): member = ctx.message.author role = discord.utils.get(member.server.roles, name="Bots") await

Discord.py add role to user

雨燕双飞 提交于 2020-06-18 05:54:32
问题 I am new to python and creating discord bots in general and I can't for the life of me figure out how to make my bot assign a role to a user upon the users request. I have scoured the internet for hours on end and have found a few examples but they all produce and error. Here is the code I have for the command: @client.command(pass_context=True) @commands.has_role("Bots") async def add_bot(ctx): member = ctx.message.author role = discord.utils.get(member.server.roles, name="Bots") await

MS Enterprise Bot (v4) - how to exactly do a user mention programatically

回眸只為那壹抹淺笑 提交于 2020-06-17 14:55:12
问题 I'm really tired of microsoft incomplete documentation. I have been bangin my head for a few days just to create a user mention. Scanned the internet for bits of code and tried to combine, but i still havent made it work. var reply = turnContext.Activity.CreateReply($"Test mention <at>@{name}</at>"); var entity = new Entity(); entity.SetAs(new Mention() { Text = $"<at>@{name}</at>", Mentioned = new ChannelAccount() { Name = $"{name}", Id = id } }); if (turnContext.Activity.Entities == null ||

How to Fix SSL Error on Windows 10 for Discord Bot

ε祈祈猫儿з 提交于 2020-06-13 06:35:11
问题 I have a Discord bot I've been running on a Windows 10 VM for several months, and yesterday it stopped working with the following error: raise ClientConnectorCertificateError(aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discordapp.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer cerificate (_ssl.c:1108)')] The only fix I've found online is for MacOS which involves

How to Fix SSL Error on Windows 10 for Discord Bot

99封情书 提交于 2020-06-13 06:35:05
问题 I have a Discord bot I've been running on a Windows 10 VM for several months, and yesterday it stopped working with the following error: raise ClientConnectorCertificateError(aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discordapp.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer cerificate (_ssl.c:1108)')] The only fix I've found online is for MacOS which involves