This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Discord; | |
using Discord.WebSocket; | |
using Discord.Commands; | |
using System.Linq; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Reflection; | |
using Newtonsoft.Json; | |
using System; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Command("remove")] | |
public async Task HasRemoved(SocketGuildUser user) | |
{ | |
var account = GuildAccounts.GetAccount(Context.Guild.Id); | |
if (account.hostlist.Contains(Context.User.Id)) | |
{ | |
if (account.Queue.Contains(user.Id)) | |
{ | |
account.Queue.RemoveAll(r => r == user.Id); | |
var embed = new EmbedBuilder(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Command("host")] | |
public async Task addhost(SocketGuildUser user) | |
{ | |
var account = GuildAccounts.GetAccount(Context.Guild.Id); | |
if (account.hostlist.Contains(Context.User.Id)) | |
{ | |
account.hostlist.Add(user.Id); | |
GuildAccounts.SaveAccounts(); | |
var embed = new EmbedBuilder(); | |
embed.WithTitle("Success!!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Command("time")] | |
public async Task starttime(int time) | |
{ | |
var host = Context.Guild.GetRole(GuildAccounts.GetAccount(Context.Guild.Id).HostRole); | |
IReadOnlyCollection<SocketRole> Roles = Context.Guild.GetUser(Context.User.Id).Roles; | |
List<SocketRole> userroles = Roles.ToList(); | |
if (userroles.Contains(host) || Context.Guild.GetUser(Context.User.Id).GuildPermissions.Has(GuildPermission.ManageMessages)) | |
{ | |
var guildAccount = GuildAccounts.GetAccount(Context.Guild.Id); | |
bool HalfTime = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Command("time")] | |
public async Task starttime(int time) | |
{ | |
var host = Context.Guild.GetRole(GuildAccounts.GetAccount(Context.Guild.Id).HostRole); | |
IReadOnlyCollection<SocketRole> Roles = Context.Guild.GetUser(Context.User.Id).Roles; | |
List<SocketRole> userroles = Roles.ToList(); | |
if (userroles.Contains(host) || Context.Guild.GetUser(Context.User.Id).GuildPermissions.Has(GuildPermission.ManageMessages)) | |
{ | |
var guildAccount = GuildAccounts.GetAccount(Context.Guild.Id); | |
guildAccount.HalfTime = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Command("mute")] | |
public async Task hasmuted(SocketGuildUser user, int time, string amount, [Remainder]string reason) | |
{ | |
IReadOnlyCollection<SocketRole> Roles = Context.Guild.GetUser(Context.User.Id).Roles; | |
List<SocketRole> userroles = Roles.ToList(); | |
var Staff = Context.Guild.Roles.FirstOrDefault(x => x.Name == $"{staffrole}"); | |
if (userroles.Contains(Staff)) | |
{ | |
if (amount == "minute" || amount == "m" || amount == "minutes" || amount == "min" || amount == "mins") | |
{ |