public static async Task Prefix(MRCommandCtx ctx) { var member = await ctx.GetGuild() !.GetMemberAsync(ctx.Message.Author.Id); if (!member.Roles.Any(role => role.Permissions.HasPermission(Permissions.Administrator))) { await ctx.ReplyAsync(embed : ctx.Message.Embed(ctx.Client, "Custom Prefix", "Bunu yapmak için yetkin yok.")); return; } if (String.IsNullOrEmpty(ctx.StringArguments)) { await ctx.ReplyAsync(embed : ctx.Message.Embed(ctx.Client, "Custom Prefix", "Prefixi belirtmemişsin.")); return; } if (ctx.StringArguments.Length > 5) { Console.WriteLine(ctx.StringArguments); await ctx.ReplyAsync(embed : ctx.Message.Embed(ctx.Client, "Custom Prefix", "Prefixin uzunluğu 5'ten büyük olamaz.")); return; } var config = ctx.Config; var id = (Int64)ctx.GetGuild() !.Id; String oldPrefix = ctx.Prefix; await config.InsertOrReplaceGuildAsync(new Guild { CustomPrefix = ctx.StringArguments, Id = id }); await ctx.ReplyAsync(embed : ctx.Message.Embed(ctx.Client, "Custom Prefix", $"Eski prefix: **{oldPrefix}**\n Yeni prefix: **{ctx.StringArguments}**")); }
public static async Task TantuniYe(MRCommandCtx ctx) { await ctx.ReplyAsync(embed : new DiscordEmbedBuilder { Color = Optional.FromValue(DiscordColor.Red), Title = "Tantuni Yediniz", ImageUrl = "https://i4.hurimg.com/i/hurriyet/75/750x422/5de50d0e7af50728c0967485.jpg" }); }
public static async Task PizzaYeA(MRCommandCtx ctx) { await ctx.ReplyAsync(embed : new DiscordEmbedBuilder() { Color = Optional.FromValue(DiscordColor.Red), Title = "Pizza Yediniz", ImageUrl = "https://cdn.ye-mek.net/App_UI/Img/out/650/2020/04/karisik-pizza-resimli-yemek-tarifi(20).jpg?w=650&h=487" }); }
public static async Task LahmacunYe(MRCommandCtx ctx) { await ctx.ReplyAsync(embed : new DiscordEmbedBuilder() { Color = Optional.FromValue(DiscordColor.Red), Title = "Lahmacun Yediniz", ImageUrl = "https://image.shutterstock.com/image-photo/turkish-dishes-lahmacun-pizzas-lemon-600w-630271100.jpg" }); }
public static async Task Yardim(MRCommandCtx ctx) { var currentAssembly = Assembly.GetExecutingAssembly(); var assemblyTypes = currentAssembly.GetTypes(); var tmp1 = assemblyTypes .Select(type => type.GetMethods()); var methods = new List <MethodInfo>(); foreach (var methodInfos in tmp1) { methods.AddRange(methodInfos); } var dict = methods.Where(method => method.GetCustomAttributes().Any(attr => attr is CommandAttribute)); var embedBuilder = new DiscordEmbedBuilder(); embedBuilder .WithTitle("Yardım") .WithColor(DiscordColor.Blue); String description; var descriptionBuilder = new StringBuilder(); var prefix = $"{(BotConfig.New().GetGuildAsync((Int64) ctx.Channel.GuildId).Result == null ? "g!" : BotConfig.New().GetGuildAsync((Int64) ctx.Channel.GuildId).Result!.CustomPrefix ?? "g!")}"; descriptionBuilder.AppendLine("Prefix: " + prefix); descriptionBuilder.Append("\n"); foreach (var methodInfo in dict) { var attributes = (CommandAttribute)methodInfo.GetCustomAttributes() .First(attribute => attribute is CommandAttribute); description = attributes.Description ?? "*Açıklama yok.*"; String alias = attributes.Alias ?? methodInfo.Name; descriptionBuilder.AppendLine($"**{alias}** :: {description}"); } description = descriptionBuilder.ToString(); embedBuilder.WithDescription(description); var builder = embedBuilder.Build(); await ctx.ReplyAsync(embed : builder); }
public static async Task Command(MRCommandCtx args) => await args.ReplyAsync("Ping: " + args.Client.Ping);
public static async Task Dust2(MRCommandCtx ctx) { await ctx.ReplyAsync("Dust 2 trash bruh"); }
public static async Task SigaraIc(MRCommandCtx ctx) => await ctx.ReplyAsync(embed : new DiscordEmbedBuilder { Title = "günah", Description = "verdiğin paraya yazk" });