public async Task WarnUser(IGuildUser user, [Remainder] string reason = "Brak.") { if (Context.Channel is IPrivateChannel) { return; } if (user.GuildPermissions.ManageEmojis) { return; } await ManagmentService.Warn(Context.Guild, Context.Message, user, (IGuildUser)Context.User, reason); }
public static async Task AntiAdvertisment(SocketMessage msg) { if (msg.Author.IsBot) { return; } if (msg.Channel is IPrivateChannel) { return; } var guildChannel = msg.Channel as IGuildChannel; var guild = guildChannel.Guild as SocketGuild; var user = msg.Author as SocketGuildUser; var rola = guild.Roles.FirstOrDefault(x => x.Id == 446765076490223618); if (Global.Advertismentwords.Any(word => msg.Content.ToLower().Contains(word)) == false || msg.Content.Contains("discord.gg/xXKrd5R") || user.Roles.Contains(rola)) { return; } { var pamietaj = Emote.Parse("<:thinksmart:460770233171443713>"); await msg.DeleteAsync(); var MessageToRemove = await msg.Channel.SendMessageAsync($":rage: {msg.Author.Mention} Reklamowanie cudzych serwerów nie jest dozwolone! :warning: Dopisuję ostrzeżenie.\n{pamietaj} Pamiętaj że nasz serwer ma tylko jedno oficjalne zaproszenie.\n:anger_right: Wpisz `!zaproszenie` aby je otrzymać."); await Helpers.RemoveMessage(MessageToRemove, 5); var uslessmsg = await msg.Channel.SendMessageAsync("."); string reason = "Reklamowanie innych serwerów discord."; var administrator = Global.Client.CurrentUser; await ManagmentService.Warn(guild, uslessmsg, user, administrator, reason); } }