discord

How can I properly parse for a tagged user in my Discord bot?

你说的曾经没有我的故事 提交于 2019-12-13 00:53:09
问题 I am adding profile cards onto my Discord bot, but I've come across one issue. When someone types !profile @user I am not sure how to properly parse for @user so the bot knows which profile card to lookup. I first parse message.content and then remove the 9 first chars of the message content (which is always !profile ) but the rest of the message content returns the user_id which looks <@289583108183948460> instead of the user's discrim. I have tried using re.sub to remove the special

discord.py send_message usage

99封情书 提交于 2019-12-12 22:09:20
问题 I've started working on a project to accelerate my learning of python. I'm trying to recreate a discord bot I use quite a bit since i'm already use to its features. Below is my current code import discord from discord import User from discord.ext.commands import Bot import secrets pybot = Bot(command_prefix = "!") @pybot.event async def on_read(): print("Client logged in") @pybot.command() async def hello(*args): print(User.display_name) return await pybot.say("Hello, world!") @pybot.command(

Discord.net not working on linux

陌路散爱 提交于 2019-12-12 20:57:13
问题 I'm trying to get a discord bot coded in discord.net running on a linux VPS, I'm running via mono but I keep getting this error Unhandled Exception: System.Exception: Connection lost at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7f0ad80016d0 + 0x00029> in <filename unknown>:0 at Discord.TaskManager.ThrowException () <0x419160b0 + 0x00065> in <filename unknown>:0 at Discord.Net.WebSockets.WebSocket.WaitForConnection (CancellationToken cancelToken) <0x4192a2a0 + 0x000af>

Discord FFmpeg not found

这一生的挚爱 提交于 2019-12-12 07:05:04
问题 Im coding a discord bot, and now it should play music, but if i run the command, it says "ffmpeg not found",i already installed ffmpeg as programm and in the console, here is the code: if (message.content.startsWith === `${prefix}play`) { const ytdl = require('ytdl-core'); const streamOptions = { seek: 0, volume: 1 }; const broadcast = bot.createVoiceBroadcast(); var link = arg1 bot.voiceChannel.join() .then(connection => { const stream = ytdl(arg1, { filter: 'audioonly' }); broadcast

custom CSS code for DiscordApp

本小妞迷上赌 提交于 2019-12-12 05:57:54
问题 I Just need some Custom CSS code to change my Chat text a bit on an app called DiscordApp, Auto Scroll To bottom of Page Custom Text Size Custom Avatar Text Channel Size Link to DiscordApp Link to Example CSS sheet for a random Theme 回答1: To inject custom CSS and JS into Discord, you'll need a third party plugin such as BetterDiscord For the case of BetterDiscord, you have to follow their tutorial for the CSS changes. You can also dive into the settings and add it straight into custom CSS.

Why doesn't my Python code see the imported discord.py module?

匆匆过客 提交于 2019-12-12 05:13:49
问题 I'm trying to make my first Discord Bot using Python, and it works perfectly on my desktop Windows computer. I also have a laptop running Ubuntu that I cloned the repository to in Intellij that isn't working correctly. Because I'm using slightly different Python versions (3.6.1 vs 3.5.2), I set it up to ignore my misc.xml file since it includes a Project-JDK-Name. I manually recreated it on my laptop based on an autogenerated one from another project (3.5.2). On the laptop, it underlines the

How to check if discord bot is the user entering a command

泄露秘密 提交于 2019-12-12 04:07:56
问题 Here is my code import discord import asyncio import sys import commands import pickle import os import random import array #if len(sys.argv) != 2: # print('Usage: python3 main.py [token]') commandz=("yes","no","hi","hi") try: with open(os.path.join(os.path.dirname(__file__), "token.pickle"), 'rb') as file: token = pickle.load(file) if len(token) == 59: key = int(random.random() * 10000000000000000) print('Found saved token in stored.py, use phrase tokenreset'+str(key), 'to undo this.')#youll

Discord Bot ( using C# ) does not execute the command

最后都变了- 提交于 2019-12-12 02:27:16
问题 I wrote a Discord Bot. It's developed with C#. My command list is filled, the command value receives this list. But the command does not execute the code when calling it. My prefix char is '!' followed by the command. My base class looks this: public class Bot { string token = "#######################"; // my Token CommandService command; // The commands holder EventController eventController = new EventController(); // event class CommandController commandController = new CommandController()

Discord API giving errors when trying to import it

允我心安 提交于 2019-12-12 00:06:07
问题 I've been trying to get the Discord API installed and working but I can't for the life of me figure out how. The first thing I tried was to simply install the Discord API using py -m pip install discord It installed but when I imported it, I got this error File "<stdin>", line 1, in <module> File "C:\Users\Harry\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\__init__.py", line 20, in <module> from .client import Client, AppInfo, ChannelPermissions File "C:\Users\Harry

Deleting single channel/all channels does not work

痴心易碎 提交于 2019-12-11 22:27:35
问题 I'm creating a bot that manages a server to get used to JavaScript and the Discord.js library. I tried deleting a channel using this code, but it didn't work. guild.channel.delete('Making room for new channels') .then(deleted => console.log(`Deleted ${deleted.name} to make room for new channels`)) .catch(console.error); I've already tried to replace the first line with channel.delete and channel.guild.delete , but I kind of gave up since I have no clue on how to make it delete every channel