public ReactionRoleService(DiscordSocketClient client, GuildsDefinition guildsDefinition) { this.client = client; this.guildsDefinition = guildsDefinition; client.ReactionAdded += ReactionAdded; client.ReactionRemoved += ReactionRemoved; client.ReactionsCleared += ReactionCleared; }
public async Task MainAsync() { if (!LoadBotDefinition()) { throw new Exception("No token provided."); } guildsDefinition = new GuildsDefinition(); client = new DiscordSocketClient(new DiscordSocketConfig { LogLevel = LogSeverity.Info, MessageCacheSize = 100 }); client.Log += Log; client.Ready += OnReadyAsync; lavaConfig = new LavaConfig(); lavaNode = new LavaNode(client, lavaConfig); reactionRoleService = new ReactionRoleService(client, guildsDefinition); commandService = new CommandService(); commandHandler = new CommandHandler(BuildServiceProvider(), client, commandService, botDefinition); await commandHandler.InstallCommandsAsync(); await client.LoginAsync(TokenType.Bot, token); await client.StartAsync(); await client.SetGameAsync(botDefinition.GetCurrent().status, null, ActivityType.Playing); // Block this task until the program is closed. await Task.Delay(-1); }
public ReactionRoleModule(DiscordSocketClient client, GuildsDefinition guildsDefinition, ReactionRoleService roleService) { this.client = client; this.guildsDefinition = guildsDefinition; this.roleService = roleService; }
public UserModule(GuildsDefinition gd) { guildsDefinition = gd; }
public SettingsUserModule(GuildsDefinition guildsDefinition) { gd = guildsDefinition; }