You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using Discord;
-
- public class SampleModule : InteractionModuleBase<SocketInteractionContext>
- {
- private readonly ApplicationDbContext _db;
-
- public SampleModule(ApplicationDbContext db)
- {
- _db = db;
- }
-
- [SlashCommand("sample", "sample")]
- public async Task Sample()
- {
- // Do stuff with your injected DbContext
- var user = _db.Users.FirstOrDefault(x => x.Id == Context.User.Id);
-
- ...
- }
- }
|