finished .streamrole
This commit is contained in:
parent
b8573f11b5
commit
17719dd8e2
@ -2,13 +2,11 @@
|
||||
using Discord.Commands;
|
||||
using NadekoBot.Attributes;
|
||||
using NadekoBot.Services.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NadekoBot.Modules.Utility.Commands
|
||||
namespace NadekoBot.Modules.Utility
|
||||
{
|
||||
public partial class Utility
|
||||
{
|
||||
public class StreamRoleCommands : NadekoSubmodule
|
||||
{
|
||||
@ -20,6 +18,8 @@ namespace NadekoBot.Modules.Utility.Commands
|
||||
}
|
||||
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
[RequireBotPermission(GuildPermission.ManageRoles)]
|
||||
[RequireUserPermission(GuildPermission.ManageRoles)]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task StreamRole(IRole fromRole, IRole addRole)
|
||||
{
|
||||
@ -29,6 +29,8 @@ namespace NadekoBot.Modules.Utility.Commands
|
||||
}
|
||||
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
[RequireBotPermission(GuildPermission.ManageRoles)]
|
||||
[RequireUserPermission(GuildPermission.ManageRoles)]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task StreamRole()
|
||||
{
|
||||
@ -37,3 +39,4 @@ namespace NadekoBot.Modules.Utility.Commands
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -167,6 +167,7 @@ namespace NadekoBot
|
||||
var patreonRewardsService = new PatreonRewardsService(Credentials, Db, Currency, Client);
|
||||
var verboseErrorsService = new VerboseErrorsService(AllGuildConfigs, Db, CommandHandler, helpService);
|
||||
var pruneService = new PruneService();
|
||||
var streamRoleService = new StreamRoleService(Client, Db, AllGuildConfigs);
|
||||
#endregion
|
||||
|
||||
#region permissions
|
||||
@ -236,6 +237,7 @@ namespace NadekoBot
|
||||
.Add(verboseErrorsService)
|
||||
.Add(patreonRewardsService)
|
||||
.Add(pruneService)
|
||||
.Add(streamRoleService)
|
||||
.Add<SearchesService>(searchesService)
|
||||
.Add(streamNotificationService)
|
||||
.Add(animeSearchService)
|
||||
|
@ -50,7 +50,11 @@ namespace NadekoBot.Services.Utility
|
||||
{
|
||||
//get needed roles
|
||||
fromRole = after.Guild.GetRole(setting.FromRoleId);
|
||||
if (fromRole == null)
|
||||
throw new InvalidOperationException();
|
||||
addRole = after.Guild.GetRole(setting.AddRoleId);
|
||||
if (addRole == null)
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user