bots

Making discord bot mention someone

两盒软妹~` 提交于 2021-02-11 12:39:12
问题 How do I make my bot mention someone on the server? module.exports = { name: 'mention', description: 'this is a mention command!', execute(message) { mention = message.mentions.users.first(); message.channel.send('Hello' + mention); }, }; I thought it would work but it doesn't. Is there another way to mention someone? 回答1: message.mentions.users.first() returns an object, which is why it's not working. This is the correct way to mention someone: mention = message.mentions.users.first();

This python code is not solving equations

心已入冬 提交于 2021-02-11 12:02:58
问题 I have a chat bot for an Instant messenger and I am trying to make a math solver for it but it can't send the solution of equation to the Instant messenger, it sends equation instead. If someone from Instant messenger sends "solve: 2+2", this program should send them "4" not "2+2". Main problem: if (parser.getPayload().lower()[:6]=="solve:"): parser.sendGroupMessage(parser.getTargetID(), str(parser.getPayload()[7:])) output: it's sending same input again not the answer of equation Test: I

BotFramework: The bot's MSA appId or password is incorrect

烂漫一生 提交于 2021-02-10 20:52:10
问题 Issue: Bot started showing me an error, when using the emulator. While i am not sure, i think the emulator might have been updated Debugging I checked that the AppID and secret are correct. Error: -> POST 401 [conversationUpdate] Error: The bot's MSA appId or password is incorrect. Edit your bot's MSA info web.config Info: <!-- update these with your appid and one of your appsecret keys--> <add key="MicrosoftAppID" value="XXXXXXXXXXXXXX" /> <add key="MicrosoftAppPassword" value="YYYYYYYYYY" /

BotFramework: The bot's MSA appId or password is incorrect

三世轮回 提交于 2021-02-10 20:43:27
问题 Issue: Bot started showing me an error, when using the emulator. While i am not sure, i think the emulator might have been updated Debugging I checked that the AppID and secret are correct. Error: -> POST 401 [conversationUpdate] Error: The bot's MSA appId or password is incorrect. Edit your bot's MSA info web.config Info: <!-- update these with your appid and one of your appsecret keys--> <add key="MicrosoftAppID" value="XXXXXXXXXXXXXX" /> <add key="MicrosoftAppPassword" value="YYYYYYYYYY" /

Python message.content discord bot

隐身守侯 提交于 2021-02-10 18:43:50
问题 I would like a help, I am trying to make my bot in discord to respond automatically when someone writes some word, the problem is that the command only works if the word is the first thing to be written in the sentence. I wish my bot could respond to the message even when the word is in the middle of some sentence. What should I do? 回答1: Bot = commands.Bot(command_prefix="") @Bot.event async def on_message(message): if "not" in message.content: await Bot.send_message(message.channel, 'yes')

Python message.content discord bot

大憨熊 提交于 2021-02-10 18:41:53
问题 I would like a help, I am trying to make my bot in discord to respond automatically when someone writes some word, the problem is that the command only works if the word is the first thing to be written in the sentence. I wish my bot could respond to the message even when the word is in the middle of some sentence. What should I do? 回答1: Bot = commands.Bot(command_prefix="") @Bot.event async def on_message(message): if "not" in message.content: await Bot.send_message(message.channel, 'yes')

botframework - How to include Adaptive card inside the carousel

你说的曾经没有我的故事 提交于 2021-02-10 18:27:31
问题 Did anybody tried to include adaptivecards inside a carousel? I am using nodejs sdk of botframework. 回答1: I believe what you are looking for is included in this example inside the botbuild-samples repository. in this example this is how the cards are built: function getCardsAttachments(session) { return [ new builder.HeroCard(session) .title('Azure Storage') .subtitle('Offload the heavy lifting of data center management') .text('Store and help protect your data. Get durable, highly available

ajaxExtended call Failed error in azuure bot services

末鹿安然 提交于 2021-02-10 18:12:58
问题 I have encountered "ajaxExtended call failed" error when tried to create a bot using the Azure services. I don't have any SDK bot that I can migrate. Provided the screenshot below. Error Screenshot 回答1: I had the same issue when I was trying to build a Web App Bot with the same name as one I'd recently deleted. I changed the name and it worked. 来源: https://stackoverflow.com/questions/47879679/ajaxextended-call-failed-error-in-azuure-bot-services

How can I make a reactionCollector on a remove event work?

若如初见. 提交于 2021-02-10 14:44:26
问题 So, I am working on a discord bot. Here I start a reactionCollector . When a reaction is collected, it does something, and when the reaction is removed, it should do something else. await message.channel.send(embed) then(async function (message) { await message.react('⚔') const filter = (reaction, user) => { return reaction.emoji.name === '⚔' && user.id != 705462496646922311 }; collector = message.createReactionCollector(filter); collector.on('collect', async (reaction, user) => { // Do

How to capture output of subprocess.call

最后都变了- 提交于 2021-02-10 05:15:10
问题 I have made a script that tells me the temperature of my Raspberry Pi 3, but there is a problem with the script. The result output is the bot saying "Your RPI3 temp is currently 0". What is wrong with my code? @bot.command(pass_context=True) async def vcgencmdmeasure_temp(ctx): if ctx.message.author.id == "412372079242117123": await bot.say("OK....") return_code = subprocess.call("vcgencmd measure_temp", shell=True) await bot.say("KK done") await bot.say("Your RPI3 temp is currently: {}"