bots

Get Message By ID: Discord.js

我只是一个虾纸丫 提交于 2020-06-08 17:01:12
问题 I am doing a report system for a discord bot and I want the player to report a specific message by the id so that the moderators can decide if it is offensive or not. I am struggling to find a way to get the message's text from the given id. Is there a possible way of doing this? 回答1: You can retrieve a message by id through msg.channel.fetchMessage(); The documentation is here. If you want to be able to retrieve a message from any channel by id, you can loop through all channels and catch

Get Message By ID: Discord.js

守給你的承諾、 提交于 2020-06-08 17:00:47
问题 I am doing a report system for a discord bot and I want the player to report a specific message by the id so that the moderators can decide if it is offensive or not. I am struggling to find a way to get the message's text from the given id. Is there a possible way of doing this? 回答1: You can retrieve a message by id through msg.channel.fetchMessage(); The documentation is here. If you want to be able to retrieve a message from any channel by id, you can loop through all channels and catch

Discord JS - How to react multiple times to the same embed?

大城市里の小女人 提交于 2020-05-31 06:04:20
问题 I've only gotten the first "moneybag" emoji to react to the newest message in the channel, which is the embed that the bot sends, however, I want the bot to react to the new embed with both the "money bag" and "ticket" emojis and so far it will react with the "money bag" emoji but, errors out when it tries to react with the "ticket" emoji. How do I get the bot to react to the new embed with both emojis? if (message.content === '-new') { const filter = (reaction, user) => { return ['💰', '🎟']

How to avoid being detected as bot on Puppeteer and Phantomjs?

Deadly 提交于 2020-05-24 11:32:53
问题 Puppeteer and PhantomJS are similar. The issue I'm having is happening for both, and the code is also similar. I'd like to catch some informations from a website, which needs authentication for viewing those informations. I can't even access home page because it's detected like a "suspicious activity", like the SS: https://i.imgur.com/p69OIjO.png I discovered that the problem doesn't happen when I tested on Postman using a header named Cookie and the value of it's cookie caught on browser,

How to avoid being detected as bot on Puppeteer and Phantomjs?

谁都会走 提交于 2020-05-24 11:32:10
问题 Puppeteer and PhantomJS are similar. The issue I'm having is happening for both, and the code is also similar. I'd like to catch some informations from a website, which needs authentication for viewing those informations. I can't even access home page because it's detected like a "suspicious activity", like the SS: https://i.imgur.com/p69OIjO.png I discovered that the problem doesn't happen when I tested on Postman using a header named Cookie and the value of it's cookie caught on browser,

My discord.py bot with chat-filter event sends 2 or more messages instead of 1

左心房为你撑大大i 提交于 2020-05-17 06:16:04
问题 Not so long ago added in my discord bot chat-filter ,which delete messages which i dont want to see.But i have a problem with this.Before this new event my bot sends on the command $hello 1 message(hello,{me}),but with this chat filter he sends 2 or more questions(Number of posts = number of banned words).Can u heip me with this. @Bot.event async def on_message( message ): filter = ['!leave', '!play','!skip'] for word in filter: if word in message.content: print('%s bad word' % (message

Discord JDA - Invalid Member List

拈花ヽ惹草 提交于 2020-05-16 19:10:27
问题 I am creating a Discord bot and have encountered a strange problem. I need to go through each user on the server and perform a conditional action. But when receiving a list of all Members, it contains only me and the bot itself. public class Bot extends ListenerAdapter { public void onGuildMessageReceived(GuildMessageReceivedEvent Event) { String Message = Event.getMessage().getContentRaw(); if(Message.charAt(0) == Globals.BOT_PREFIX) { String[] Args = Message.split("\\s+"); if(Args[0]

Using Azure AD B2C with Bot

醉酒当歌 提交于 2020-05-16 16:15:13
问题 I've created a bot in Azure that uses a SignInCard to give users the option to log-in or register as customers. This is the SignInCard I currently have: messageActivity.Attachments.Add(new SigninCard() { Buttons = new List<CardAction>() { new CardAction() { Title = "Log in here", DisplayText = "Log in here", Value = "https://login.microsoftonline.com/XXXXXXXX.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1_SiUp&client_id=XXXXX-XXXX-XXXX-XXXX-XXXXXXXd&nonce=defaultNonce&redirect_uri=http%3A%2F

Not able to create a Web App Bot through Azure portal, getting ServiceError: CreateAppOnlySteps

戏子无情 提交于 2020-05-15 09:26:07
问题 I am trying to create a Web App Bot in Azure, getting error ServiceError: CreateAppOnlySteps https://i.stack.imgur.com/8ayNW.png 回答1: it seems like error : ServiceError: CreateAppOnlySteps is due to insufficient permissions. Can you check, do you have access to create an APP Registration under Azure Active Directory. If yes, follow below link and create an APP & Secret using below link : https://docs.microsoft.com/en-us/azure/bot-service/bot-service-resources-bot-framework-faq?view=azure-bot

Discord.py Bot sending file to Discord Channel

若如初见. 提交于 2020-05-15 05:53:10
问题 I am trying to make my discord bot send a jpg file to my discord server, but I keep getting an error that seems pretty uncommon as I can not find any solutions to it on the internet... the error is... discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientRequestError: Can not write request body for https://discordapp.com/api/v6/channels/454374995758678029/messages My imports are import time import discord from discord.ext import commands from discord.ext.commands