discord.net

Connecting to a voice channel and sending audio in Discord.net

我与影子孤独终老i 提交于 2020-01-04 18:56:39
问题 After looking for hours I still can't find how should I set up sending an audio using Discord.net 1.0. All of the solutions I encountered have been for pre-1.0 relases and as far as I can see, new API is completly different. So my question is: How do i join voice channel and send music through? Do I need external libraries (NAudio)? 回答1: If someone is looking for Audio example it's here. You also need opus and libsodium in bot running directory. You can get this libraries on Discord "Discord

DiscordClient not recognized

浪子不回头ぞ 提交于 2019-12-27 01:31:33
问题 Hey I am trying to create a bot using c#, but am getting an error when I type DiscordClient. this is my program.cs file using System; namespace firstbot { class MainClass { public static void Main(string[] args) { MyBot bot = new MyBot(); } } } Here is the MyBot.cs file using System; using Discord; using Discord.Commands; namespace firstbot { public class MyBot { DiscordClient discord; //error comes here public MyBot() { } } } the error is: the type of namespace DiscordClient could not be

DiscordClient not recognized

帅比萌擦擦* 提交于 2019-12-27 01:30:50
问题 Hey I am trying to create a bot using c#, but am getting an error when I type DiscordClient. this is my program.cs file using System; namespace firstbot { class MainClass { public static void Main(string[] args) { MyBot bot = new MyBot(); } } } Here is the MyBot.cs file using System; using Discord; using Discord.Commands; namespace firstbot { public class MyBot { DiscordClient discord; //error comes here public MyBot() { } } } the error is: the type of namespace DiscordClient could not be

Discord C# User Join messages

回眸只為那壹抹淺笑 提交于 2019-12-20 02:05:49
问题 I'm using Discord.Net in C#, making a bot. My bot works fantastic so far, but I want it to automatically assign users a specific role when they join a specific server. I've never actually learned any C#, only a bit of C++ so I know the basic Grammar. How would I go about this? I'm assuming I would use UserJoined, but doing this heeds results telling me to use it before or after a += or -+ (Which I understand, but I don't understand it's usefullness in this given scenario) 回答1: You gave little

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>

C# Discord Bot - Upload Local Image

一曲冷凌霜 提交于 2019-12-11 15:57:51
问题 I created this bot using C# to help my alliance out in a phone game. We are using discord to communicate. One of the functions of my bot is to set up "Raid Lane" so people can claim the path they are going to take. Our alliance has an image set spread out across our discord, I want to have the relevant image to each raid be posted when the bot sets up the raid lanes for that difficulty. Currently i have : var embed = new EmbedBuilder(); embed.WithTitle("Ultimus Raid - Level 40"); embed

Discord.NET sending messages to one specific channel in one specific server

对着背影说爱祢 提交于 2019-12-11 06:09:48
问题 So I'm trying to send a message to a specific channel, but I've been looking and found I can't see any way I can do that. I might be doing something wrong or I'm looking in the wrong area, I've looked on Google and couldn't find an answer. This is my code when trying to find it. discord.GetGuild("serverid").GetChannel("Channelid") As far as I can see, this is not the way to do it, but I don't know where else to check :\ 回答1: Actually, I kinda feel stupid after realizing this, In my code

Discord.NET - Bot immediately disconnects after joining voice channel

依然范特西╮ 提交于 2019-12-02 09:03:13
问题 I have all of the libraries (libopus.dll and libsodium.dll), I have FFMPEG and an audio file in my execution path, but still the bot immediately disconnects after joining the channel. Why is this happening and how do I fix it? EDIT: I use this sample for audio: https://gist.github.com/Joe4evr/773d3ce6cc10dbea6924d59bbfa3c62a 回答1: These are a few things I pulled from the official Discord API guild. Windows 64-bit: https://dsharpplus.emzi0767.com/natives/vnext_natives_win32_x64.zip Windows 32

Discord bot running, but will not connect to server

╄→гoц情女王★ 提交于 2019-12-02 07:37:44
问题 I've been trying to swap over my code from the 0.9.6 Discord.NET API to the new 1.0.1 API, and it's basically calling for a complete restructure to my code. But I've been having some trouble actually getting the bot up and running first of all. I set up the code body according to the guide linked here And while it runs without error, the bot itself is not appearing online in my server. And before you ask, I had in fact replaced "Bot token here" with the actual bot token. namespace DiscordBot{

Discord.NET - Bot immediately disconnects after joining voice channel

岁酱吖の 提交于 2019-12-02 04:55:25
I have all of the libraries (libopus.dll and libsodium.dll), I have FFMPEG and an audio file in my execution path, but still the bot immediately disconnects after joining the channel. Why is this happening and how do I fix it? EDIT: I use this sample for audio: https://gist.github.com/Joe4evr/773d3ce6cc10dbea6924d59bbfa3c62a These are a few things I pulled from the official Discord API guild. Windows 64-bit: https://dsharpplus.emzi0767.com/natives/vnext_natives_win32_x64.zip Windows 32-bit: https://dsharpplus.emzi0767.com/natives/vnext_natives_win32_x86.zip FFmpeg for Windows: https:/