Questions tagged [dsharp+]

Use for the DSharp+ library for Discord bots.

DSharp+ is a C# library for making bots using the Discord API. (.NET framework)

https://github.com/DSharpPlus/DSharpPlus

68 questions
7
votes
2 answers

.NET Console App with Entity Framework Core: 'The process has no package identity' only when started without debugging

I have a .NET Console App integrated with Entity Framework and Discord Sharp Plus with the following…
Ali Bdeir
  • 4,151
  • 10
  • 57
  • 117
3
votes
1 answer

How can I set a DiscordColor in DiscordSharpPlus to a random RGB color?

I have a Discord bot and I'm trying to make an embed with a random RGB color. When I try to use this command in discord, it simply returns nothing. My code for this is: DiscordEmbedBuilder Embed = new DiscordEmbedBuilder { Color = new…
two
  • 55
  • 6
3
votes
1 answer

Is there a way to change command prefix without restarting a bot for changes to take action? (DSharpPlus)

I'm using this code to set configuration and register commands for CommandsNextExtension variable: commandsConfig = new CommandsNextConfiguration { StringPrefixes = new string[] {prefix}, EnableDms = false, …
REtangle
  • 33
  • 3
2
votes
1 answer

How to create a command handler in DSharpPlus?

I'm coming from Nextcord where we have cogs, but here I'm confused. What if I want one command per class? Do I have to register them all manually? Here's what I'm doing now: I have a Bot class that has: var slash = discord.UseSlashCommands();…
Alexciao
  • 25
  • 4
2
votes
0 answers

How to create private discord channel using DSharpPlus?

I am trying to make a bot command to create a private channel, however, when I call it nothing happens even though the bot has full Administrator permissions granted. Here is the command: ```[Command("makeprivate")] public async Task…
2
votes
1 answer

DSharpPlus edit channel topic

I'm trying to edit a text channel's topic. I tried using DiscordChannel.ModifyAsync but I have no idea what an Action is. How can I use it?
2
votes
1 answer

How do I check if a user exists in Dsharplus (C# discord bot)

Basically I want if someone types "whois (mention user)" the bot to send a message like "(user mentioned in first message) is (random message from array)" I just need to know 2 things How do I only send a message if it's an actual mentioned user and…
2
votes
2 answers

DSharpPlus - WaitForReaction on existing Messages

I am trying to create a discord bot using DSharpPlus library where if you react on a message with specific emoji, you will get a specific role. The concept is pretty straight forward but I fail to figure out one rather important concept. That is,…
Bagzli
  • 6,254
  • 17
  • 80
  • 163
1
vote
1 answer

How do i disable a D#+ Command To not show for users who dont have certain permissions?

how do i disable a D#+ Command to not show for users who don't have specific permissions such as Administrator, Or Owner? a reply would be appreciated, thanks.
1
vote
0 answers

C# Discord Bot prefix for commands doesn't work

I'm having a problem with my Discord Bot where the only method of interfacing with the bot is by tagging it in a message. I've setup the code for how I thought the prefix functionality was supposed to work, but I've done something wrong. I don't get…
edakk
  • 11
  • 2
1
vote
1 answer

How do you add thumbnails to an embed message in DSharpPlus?

I have been bashing my head against the wall for 8 hours now, trying to figure out how to add thumbnails to embeded messages. I've been following this tutorial that uses ThumbnailURL, something that doesn't exist in the context he's using it for.…
A Fish
  • 21
  • 3
1
vote
0 answers

How to stream youtube audio with ffmpeg discord bot

so at the moment I got my disord bot to play audio from a filepath with this code var transmit = vnc.GetTransmitSink(); var pcm = ConvertAudioToPcm(filepath); await pcm.CopyToAsync(transmit); …
Jamesaf
  • 35
  • 2
1
vote
0 answers

Using a MemoryStream with .NET's System.Speech SpeechRecognitionEngine class

I am trying to use .NET's System.Speech SpeechRecognitionEngine object to recognize words spoken by a discord user in a voice channel. The raw pcm audio received by the bot is written to a MemoryStream, and I am trying to get the…
Cojack
  • 37
  • 1
  • 9
1
vote
0 answers

How to create a list of all members in dsharpplus? (dsharp+)

I want to create a list of all usernames/displaynames of all the members in my discord server in dsharpplus. Here is the code I have now: List users = (List)(await c.Guild.GetAllMembersAsync().ConfigureAwait(false)).Select(member =>…
1
vote
0 answers

playerdb.co API not returning anything, no errors, just leaves variable empty

I've been trying to access an API for my discord bot to convert the input from an argument in the discord command to a username. For example, if I were to input the discord command ?bw Tiim into discord, it would return an embed with my bedwars…
Tim Nguyen
  • 11
  • 2
1
2 3 4 5