bots

How to Play Audio File Into Channel?

我只是一个虾纸丫 提交于 2019-12-20 09:46:00
问题 How do you play an audio file from a Discord bot? Needs to play a local file, be in JS, and upon a certain message being sent it will join the user who typed the message, and will play the file to that channel. 回答1: GitHub Project: LINK In order to do this there are a few things you have to make sure of first. Have FFMPEG installed & the environment path set for it in Windows [link] Have Microsoft Visual Studio (VS) installed [link] Have Node.js installed.[link] Have Discord.js installed in

How do i program a simple IRC bot in python?

允我心安 提交于 2019-12-20 08:09:48
问题 I need help writing a basic IRC bot that just connects to a channel.. is anyone able to explain me this? I have managed to get it to connect to the IRC server but i am unable to join a channel and log on. The code i have thus far is: import sockethost = 'irc.freenode.org' port = 6667 join_sock = socket.socket() join_sock.connect((host, port)) <code here> Any help would be greatly appreciated. 回答1: It'd probably be easiest to base it on twisted's implementation of the IRC protocol. Take a look

I am trying to make a discord.js avatar command, and the mentioning portion doesn't work correctly

流过昼夜 提交于 2019-12-20 07:35:17
问题 I have an avatar command in my discord bot. When the user uses h.avatar , it outputs their avatar, which works fine. Whenever they try to use h.avatar @user , nothing happens. Here is my code: } if (message.content.startsWith(config.prefix + "avatar")) { if (!message.mentions.users.size) { const avatarAuthor = new Discord.RichEmbed() .setColor(0x333333) .setAuthor(message.author.username) .setImage(message.author.avatarURL) message.channel.send(avatarAuthor); let mention = message.mentions

Telegram Bot API: Server down when use getUserProfilePhotos()

十年热恋 提交于 2019-12-20 04:25:31
问题 Context I am using telegraf.js for more than 3 bots which run very well in plenty of groups. Currently one of the bots needs to request for Display Picture of the user who does not have a display picture. It works very well as expected but unfortunately the bot throws an error and the server goes down Current Code // Request for display picture const requestDP = async (ctx, next) => { const { from, chat } = ctx.message; const { can_delete_messages:canDelete } = await deletePermision(ctx); let

Azure Bot code seems to be erased

别说谁变了你拦得住时间么 提交于 2019-12-20 04:10:53
问题 I'm working on a bot (in testing) using the Azure Bot framework and the chat embed code. I had started from the LUIS framework template and embedded it into a section of my website several days ago. It was working as expected, but now all of the files/code for it (using the Azure editor) seem to be erased and the chat embed throws a 502. This looks like it may be similar to this: How to recover a bot made with Azure Bot Service (Botframework)? But that did not have an answer that I could work

getaddrinfo ENOTFOUND API Google Cloud

☆樱花仙子☆ 提交于 2019-12-19 10:05:05
问题 I'm trying to execute API.AI tutorial for building a weather bot for Google Assistant (the one here: https://dialogflow.com/docs/getting-started/basic-fulfillment-conversation) I made everything successfully, created the bot within API, created the Fulfillments, installed NodeJS on my pc, connected Google Cloud Platform, etc. Then I created the index.js file by copying it exactly how it's stated on API.ai tutorial with my API key from World Weather Organisation (see below). But when I use the

Adaptive Card response from a WaterfallStep Dialog MS Bot framework v4

浪尽此生 提交于 2019-12-19 08:12:42
问题 I am trying to send an adaptive card which has 2 options for user to select. When user submit the response from adaptive card I am receiving : Newtonsoft.Json.JsonReaderException: Error reading JArray from JsonReader. Current JsonReader item is not an array: StartObject. Path ‘[‘BotAccessors.DialogState’].DialogStack.$values[0].State.options.Prompt.attachments.$values[0].content.body’. Full code example Link : Manage a complex conversation flow with dialogs Modification made in HotelDialogs

Adaptive Card response from a WaterfallStep Dialog MS Bot framework v4

99封情书 提交于 2019-12-19 08:12:42
问题 I am trying to send an adaptive card which has 2 options for user to select. When user submit the response from adaptive card I am receiving : Newtonsoft.Json.JsonReaderException: Error reading JArray from JsonReader. Current JsonReader item is not an array: StartObject. Path ‘[‘BotAccessors.DialogState’].DialogStack.$values[0].State.options.Prompt.attachments.$values[0].content.body’. Full code example Link : Manage a complex conversation flow with dialogs Modification made in HotelDialogs

Facebook messenger API bot : “Typing bubble” “ indicator bubble”

给你一囗甜甜゛ 提交于 2019-12-18 19:06:29
问题 I've created a messenger bot, and some action that I perform can take some time. So in order to make the user wait I would like to display the "Indicator Bubble" (the one you see when the people you talk with are typing): Typing bubble It is not defined in the Messenger API documentation how to do it, but it seems possible has they perform it when you hit "callBack" on their card. How can I simulate this? 回答1: It's now available into the messenger bot API via the Sender Action. You can find

Auto fill and submit forms on external site

折月煮酒 提交于 2019-12-18 13:36:42
问题 I was wondering how does one auto fill multiple forms (using bot/local server ) on multiple pages of external site (PHP) using ajax or curl. For example a site www.abc.com/index.php has a form <form> <input name='text'></form> which takes you to the www.abc.com/fst.php when the form is submitted and there is another form on www.abc.com/fst.php that needs to be filled and submitted too. I want to automatically fill both form from my local server. How do i accomplish that? 回答1: The easiest way