dapperdino / discord-bot-tutorial Goto Github PK
View Code? Open in Web Editor NEWRepo for my "Discord Bot Tutorial" series.
License: MIT License
Repo for my "Discord Bot Tutorial" series.
License: MIT License
These examples no longer work.
Commands = Client.UseCommandsNext(commandsConfig); is shownig an error
(0029: cannot implicitly convert type 'DSharpPlus.CommandsNext.CommandsNextExtension' to 'DSharpPlus.CommandsNext.CommandsNextConfiguration')
can you please help me?
This tutorial a Whole video used DSharpPlus 4.0.0-nightly-00635
the problem is too much diff with the newer pre release so as a newbie cannot follow
as pre release the version is increasing fast and older one will be removed
i think the package DSharpPlus 4.0.0-nightly-00812 must be included in this tutorial also.
[2021-10-30 21:41:33 +06:00] [101 /Startup ] [Info ] DSharpPlus, version 4.0.0-rc1
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\Users\ASUS ROG\Desktop\Discord-Bot-Tutorial-master\DiscordBotTutorial.Bots\bin\Debug\netcoreapp3.1
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 3.1.1 initialized 'RPGContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: MigrationsAssembly=DiscordBotTutorial.DAL.Migrations
fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
Failed executing DbCommand (42ms) [Parameters=[@__guildId_0='?' (DbType = Decimal), @__discordId_1='?' (DbType = Decimal)], CommandType='Text', CommandTimeout='30']
SELECT [t].[Id], [t].[DiscordId], [t].[Gold], [t].[GuildId], [t].[Xp], [t0].[Id], [t0].[ItemId], [t0].[ProfileId], [t0].[Id0], [t0].[Description], [t0].[Name], [t0].[Price]
FROM (
SELECT TOP(1) [p].[Id], [p].[DiscordId], [p].[Gold], [p].[GuildId], [p].[Xp]
FROM [Profiles] AS [p]
WHERE ([p].[GuildId] = @__guildId_0) AND ([p].[DiscordId] = @__discordId_1)
) AS [t]
LEFT JOIN (
SELECT [p0].[Id], [p0].[ItemId], [p0].[ProfileId], [i].[Id] AS [Id0], [i].[Description], [i].[Name], [i].[Price]
FROM [ProfileItems] AS [p0]
INNER JOIN [Items] AS [i] ON [p0].[ItemId] = [i].[Id]
) AS [t0] ON [t].[Id] = [t0].[ProfileId]
ORDER BY [t].[Id], [t0].[Id], [t0].[Id0]
fail: Microsoft.EntityFrameworkCore.Query[10100]
An exception occurred while iterating over the results of a query for context type 'DiscordBotTutorial.DAL.RPGContext'.
Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'Profiles'.
at Microsoft.Data.SqlClient.SqlCommand.<>c.b__164_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask
2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func
4 operation, Func4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable
1.AsyncEnumerator.MoveNextAsync()
ClientConnectionId:68e0044b-ddcb-4b05-af6e-0cb66be37432
Error Number:208,State:1,Class:16
Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'Profiles'.
at Microsoft.Data.SqlClient.SqlCommand.<>c.b__164_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask
2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func
4 operation, Func4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable
1.AsyncEnumerator.MoveNextAsync()
ClientConnectionId:68e0044b-ddcb-4b05-af6e-0cb66be37432
Error Number:208,State:1,Class:16
The OnClientReady function is not working with Client.Ready and is coming up with an error stating:
Error CS0123 No overload for 'OnClientReady' matches delegate 'AsyncEventHandler<DiscordClient, ReadyEventArgs>' MrBastard 18 Active
my code for the "Bot.cs" file:
namespace MrBastard
{
public class Bot
{
public DSharpPlus.DiscordClient Client { get; private set; }
public async Task RunAsync()
{
var config = new DSharpPlus.DiscordConfiguration
{
};
Client = new DSharpPlus.DiscordClient(config);
Client.Ready += OnClientReady; <-- line 18
}
private Task OnClientReady(DSharpPlus.EventArgs.ReadyEventArgs e)
{
return null;
}
}
}
Don't know why it is doing this or how to fix it. Help would be appreciated.
Commands = Client.UseCommandsNext(commandsConfig); is wrong for me idk why im still on the first tutorial
so I am trying to create a commands class like in the second tutorial, but BaseCommandModule is no longer a thing and I cannot figure out what to use instead...
using DSharpPlus.CommandsNext;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RolePlayHelperBot.Commands
{
public class MainCommands : BaseCommandModule
{
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.