Exemplo n.º 1
0
        public async Task RunAsync()
        {
            ConfigJson cj     = new ConfigJson();
            var        config = new DiscordConfiguration
            {
                Token                 = cj.Token,
                TokenType             = TokenType.Bot,
                AutoReconnect         = true,
                LogLevel              = LogLevel.Debug,
                UseInternalLogHandler = true
            };

            Client = new DiscordClient(config);

            Client.Ready += OnClientReady;

            Client.GuildMemberAdded += Client_GuildMemberAdded;

            Client.GuildBanAdded += Client_GuildMemberBanned;

            Client.MessageCreated += Client_MessageSent;

            Client.MessageDeleted += Client_MessageDeleted;

            Client.GuildBanRemoved += Client_BanRemoved;

            Client.GuildMemberRemoved += Client_MemberLeave;

            var commandsConfig = new CommandsNextConfiguration
            {
                StringPrefixes      = new string[] { "!" },
                EnableDms           = false,
                EnableMentionPrefix = true,
                DmHelp = true,
                IgnoreExtraArguments = false
            };

            //Commands = Client.UseCommandsNext(commandsConfig);
            //Commands.RegisterCommands<CommandsClass>();
            await Client.ConnectAsync();

            await Task.Delay(-1);
        }
Exemplo n.º 2
0
 public CommandsClass(ConfigJson config, InMemoryStorage storage)
 {
     this.config  = config;
     this.storage = storage;
 }