#why does my clean command not work

1 messages · Page 1 of 1 (latest)

red summit
#

why does my clean command not work

deep mortar
#

define "not working". Do you get an exception?

red summit
#

no nothing bot gose online

formal gardenBOT
#
Automated suggestion: You do not have the Message Intent enabled

As of September 1st 2022, Discord started requiring message content intent for bots that want to read message content. This is a privileged intent!

If your bot has under 100 guilds, all you have to do is flip the switch in the developer dashboard. (over at https://discord.com/developers/applications, also see the image)
If your bot has over 100 guilds, you'll need approval from Discord's end.

Even though you can just use this to get away with it, it is recommended by Discord to use Slash Commands whenever possible, so look into that if you can (Slash Commands Documentation)

More info:
https://support-dev.discord.com/hc/en-us/articles/4404772028055-Message-Content-Privileged-Intent-FAQ

red summit
glad otter
#

perhaps try adding intents if you're on v4.3.0

glad otter
#

pretty sure that tutorial is deprecated

red summit
#

by itself i want a bot of the

autochannel (temporary channel)
autorole
also i want to include the riot API
slashcommands:
clean,
reactrole,
and some other things

#

i know its much for somone that doesent even know how to code but iknow i can do that XD if i want

stable python
#

psst

#

@red summit i think i know why it's not working

#

can you send me the code

#

not the ss

red summit
# stable python <@178008915567575040> i think i know why it's not working

oh okey

using DSharpPlus;
using DSharpPlus.CommandsNext;
using DSharpPlus.EventArgs;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using System;
using System.Net.Http.Headers;
using System.Text;

namespace GameoverBot
{
public class Bot
{
public DiscordClient Client { get; private set; }

    public CommandsNextExtension Commands {  get; private set; }   

    public async Task RunAsync()
    {

        var json = string.Empty;

        using(var fs = File.OpenRead("config.json"))
        using(var sr = new StreamReader(fs, new UTF8Encoding(false)))
            json = await sr.ReadToEndAsync().ConfigureAwait(false);
            
        var configJason = JsonConvert.DeserializeObject<ConfigJson>(json);

        var config = new DiscordConfiguration
        {
            Token = configJason.Token,
            TokenType = TokenType.Bot,
            AutoReconnect = true,
            LogLevel = LogLevel.Debug,
            UseInternalLogHandler = true
        };

        Client = new DiscordClient(config);

        Client.Ready += OnClientReady;

        var commandsConfig = new CommandsNextConfiguration
        {

        };
        
        Commands = Client.UseCommandsNext(commandsConfig);

        await Client.ConnectAsync();

        await Task.Delay(1);
    }

    private Task OnClientReady(DiscordClient client, ReadyEventArgs e)
    {
        return null;
    }
}

}

stable python