public async Task TipCreateMod(CommandContext ctx, DiscordUser dis) { var username = ctx.Member.Username; var eyes = DiscordEmoji.FromName(ctx.Client, ":eyes:"); var oldmessage = ctx.Message; TipModel profile = new TipModel(); var comms = new Communication(); await ctx.Message.CreateReactionAsync(eyes).ConfigureAwait(false); //get user's profile and check if they are an admin, if not don't acknowledge the command exists. //if (ctx.Guild.Id == 539405872346955788 if (ctx.Guild.Id == 826783795842777098 && profile.Role == "Admin") { string mentionedUserId = dis.Mention; mentionedUserId = mentionedUserId.Substring(2, mentionedUserId.Length - 3); ulong uLMentionedUserId = ulong.Parse(mentionedUserId); Console.WriteLine(uLMentionedUserId); //Call AdminProfileFunction to Check/Create/Assign Mod User. await Tips.AdminProfileCheck(uLMentionedUserId, "Mod"); await ctx.Channel.SendMessageAsync("UserID: " + uLMentionedUserId + " is now a Mod.").ConfigureAwait(false); } else { } }
public async Task TipCreateAdmin(CommandContext ctx, DiscordUser dis) { //Locks command to Planetarium Server and Server Owner. //if (ctx.Guild.Id == 539405872346955788 && ctx.Member.IsOwner) if (ctx.Guild.Id == 826783795842777098) //Test Server { string mentionedUserId = dis.Mention; mentionedUserId = mentionedUserId.Substring(2, mentionedUserId.Length - 3); ulong uLMentionedUserId = ulong.Parse(mentionedUserId); Console.WriteLine(uLMentionedUserId); //Call AdminProfileFunction to Check/Create/Assign Admin User. await Tips.AdminProfileCheck(uLMentionedUserId, "Admin"); await ctx.Channel.SendMessageAsync("UserID: " + uLMentionedUserId + " is now an admin.").ConfigureAwait(false); } else { await ctx.Channel.SendMessageAsync("I'm sorry, this command can only be executed in the official Planetarium Server").ConfigureAwait(false); } }