예제 #1
0
        public async Task Destroy(CommandContext e, [Description("Quote the ID at the beginning of the channel name.")] int rpID)
        {
            InstanceObject.RootObject instance = RPClass.InstanceList.FirstOrDefault(x => x.Id == rpID);
            if (instance != null)
            {
                DiscordChannel c = e.Guild.GetChannel(instance.ChannelID);
                await c.DeleteAsync();

                RPClass.InstanceList.Remove(instance);
                RPClass.SaveData(7);
                await e.RespondAsync("Instance destroyed.");
            }
            else
            {
                await e.RespondAsync("Use the ID at the beginning of the channel name.");
            }
        }
예제 #2
0
        public async Task End(CommandContext e, [Description("Quote the ID at the beginning of the channel name.")] int rpID)
        {
            InstanceObject.RootObject instance = RPClass.InstanceList.FirstOrDefault(x => x.Id == rpID);
            if (instance != null)
            {
                DiscordChannel c = e.Guild.GetChannel(instance.ChannelID);
                await c.AddOverwriteAsync(e.Guild.EveryoneRole, Permissions.ReadMessageHistory, Permissions.SendMessages);

                instance.Active = false;

                RPClass.SaveData(7);
                await e.RespondAsync("Instance closed.");
            }
            else
            {
                await e.RespondAsync("Use the ID at the beginning of the channel name.");
            }
        }