bots

Discord.py Bot How to play audio from local files

拟墨画扇 提交于 2021-01-04 06:48:41
问题 Basically the title. I installed ffmpeg and discord.py[audio] already. I just need to learn how it works. couldn't find any tutorial for local audio files. and I cant understand anything from documentations :/ 回答1: That's a function that plays a local audio file. I had problems with FFmpeg, so I hardcoded the .exe path. Also, I had a problem with the file path to the local file, so I put the absolute path in. This function also deletes the command that called it after the audio is done

Is it possible to selft mute a member with discord.js?

夙愿已清 提交于 2021-01-01 06:47:41
问题 Recently with coronavirus, school is cancelled so I made a discord server for my class. People are not very familiar with Discord so I want a command that can selfmute people so that the course can start. I want everyone to be able to unmute if they want to ask a question to the teacher, hence the self-mute and not the server-mute. I have tried this code but it's not working because the .selfmute(true) is made for the bot. const Discord = require('discord.js'); const client = new Discord

How to check if a specific user has a role? Discord js

大兔子大兔子 提交于 2020-12-26 08:39:46
问题 I know how to check if the message sender has a role: if(message.member.roles.has(role.id)) { console.log(`Yay, the author of the message has the role!`); } else { console.log(`Nope, noppers, nadda.`); } However, how can I check if specific user (using user id) has a specific role? var authorID = "111111111111111111" //Find role var role = message.guild.roles.find(role => role.name === "Private Splash Ping"); //Find member let member = message.guild.members.get(authorID); console.log(member

How to check if a specific user has a role? Discord js

泪湿孤枕 提交于 2020-12-26 08:39:09
问题 I know how to check if the message sender has a role: if(message.member.roles.has(role.id)) { console.log(`Yay, the author of the message has the role!`); } else { console.log(`Nope, noppers, nadda.`); } However, how can I check if specific user (using user id) has a specific role? var authorID = "111111111111111111" //Find role var role = message.guild.roles.find(role => role.name === "Private Splash Ping"); //Find member let member = message.guild.members.get(authorID); console.log(member

How can I embed messages using a Discord bot?

佐手、 提交于 2020-12-15 05:01:20
问题 I want to code a bot that will embed a user's sent message in a specific channel. If you know anything about GTA RP servers, it's like a Twitter or Instagram bot. Here's an example: I think it's something about the console.log and the author's name, but I'm not sure so that's why I'm here. How can I embed users' messages like this? 回答1: You can use a MessageEmbed, like programmerRaj said, or use the embed property in MessageOptions: const {MessageEmbed} = require('discord.js') const embed =

Azure LUIS Ownership change

荒凉一梦 提交于 2020-12-12 10:11:31
问题 How do I change the Owner? I want to be able to change the owner of the app because the other person is too busy. Please help. Thanks! 回答1: Any LUIS app is defined by its Azure resources, which is determined by the owner's subscription. You have to keep in mind that LUIS allows the transfer of ownership of your subscription but not transferring ownership of a resource . If you want to transfer ownership of your subscription, then you need to follow the steps below: For users who have migrated

Why I do not receive the attachments in the Facebook Messenger webhook request?

主宰稳场 提交于 2020-12-07 04:35:21
问题 Since yesterday (29/10/2020) i'm having this problem only on one of the pages linked to my app, the others work correctly: The attached messages that the webhook receives from Facebook do not contain the attachment field. Only messages with stickers contain the "attachment" field. All others (image, video, audio etc.) No. What I expect (as facebook documentation) is: { "id": "682498302938465", "time": 1518479195594, "messaging": [ { "sender": { "id": "<PSID>" }, "recipient": { "id": "<PAGE_ID

How to connect my python bot to microsoft bot connector

◇◆丶佛笑我妖孽 提交于 2020-12-06 08:10:10
问题 I want to write a python bot and I know if it is possible to connect my bot to microsoft bot connector ? 回答1: Yes it's possible. Please checkout Microsoft bot built on Django (python web framework) for implementation. Here below is a python code to reply back to Microsoft bot connector import requests app_client_id = `<Microsoft App ID>` app_client_secret = `<Microsoft App Secret>` def sendMessage(serviceUrl,channelId,replyToId,fromData, recipientData,message,messageType,conversation): url=

How to connect my python bot to microsoft bot connector

北城以北 提交于 2020-12-06 08:09:01
问题 I want to write a python bot and I know if it is possible to connect my bot to microsoft bot connector ? 回答1: Yes it's possible. Please checkout Microsoft bot built on Django (python web framework) for implementation. Here below is a python code to reply back to Microsoft bot connector import requests app_client_id = `<Microsoft App ID>` app_client_secret = `<Microsoft App Secret>` def sendMessage(serviceUrl,channelId,replyToId,fromData, recipientData,message,messageType,conversation): url=

addRole is not a function

断了今生、忘了曾经 提交于 2020-12-06 04:36:00
问题 I am creating a Discord Bot. I am trying create a Mute command, but I always get the same error. What went wrong? Background information: Discord.js version: 12.0.0-dev Klasa with version 0.5.0-dev is used Code: const { Command } = require('klasa'); const { MessageEmbed } = require('discord.js'); module.exports = class extends Command { constructor(...args) { super(...args, { description: 'Mute an user.' }) } async run(msg, args) { if(!msg.member.hasPermission("MANAGE_MEMBERS")) return msg