コード例 #1
0
            public async Task esit(CommandContext ctx, long bet)
            {
                //string chan = (await ctx.Client.GetChannelAsync(ctx.Message.ChannelId)).Name;
                //if (!(chan.StartsWith("bot") || chan.StartsWith("komut"))) return;
                long puan = Fonksiyonlar.KullaniciPuanBul(Constants.SQLCONNECTION, ctx.Message.Author.Id);

                if (puan < bet)
                {
                    await ctx.RespondAsync($"Üzgünüm {ctx.Message.Author.Mention} Yeterli Puanınız Yok. ");

                    return;
                }
                Random rnd  = new Random();
                int    sayi = rnd.Next(1, 100);

                if (ctx.User.Id == Constants.FORGAMER)
                {
                    sayi = rnd.Next(48, 53);
                }
                ;
                if (sayi == 50)
                {
                    Fonksiyonlar.KullaniciPuanDegistir(Constants.SQLCONNECTION, ctx.Message.Author.Id, puan + (bet * 95));
                    await ctx.RespondAsync($"🎲 Sayı : {sayi} Tebrikler Kazandınız {ctx.Message.Author.Mention} . Toplam Puanınız : {Fonksiyonlar.KullaniciPuanBul(Constants.SQLCONNECTION, ctx.Message.Author.Id)}");
                }
                else
                {
                    Fonksiyonlar.KullaniciPuanDegistir(Constants.SQLCONNECTION, ctx.Message.Author.Id, puan - bet);
                    await ctx.RespondAsync($"🎲 Sayı : {sayi} Üzgünüm, Kaybettiniz :/ {ctx.Message.Author.Mention} . Kalan Puanınız : {Fonksiyonlar.KullaniciPuanBul(Constants.SQLCONNECTION, ctx.Message.Author.Id)}");
                }
            }
コード例 #2
0
            public async Task puan(CommandContext ctx)
            {
                //string chan = (await ctx.Client.GetChannelAsync(ctx.Message.ChannelId)).Name;
                //if (!(chan.StartsWith("bot") || chan.StartsWith("komut"))) return;
                long puan = Fonksiyonlar.KullaniciPuanBul(Constants.SQLCONNECTION, ctx.Message.Author.Id);

                await ctx.RespondAsync($"{ctx.Message.Author.Mention} Şuanda {puan} Puana Sahipsiniz. ");
            }
コード例 #3
0
            public async Task hediye(CommandContext ctx, int miktar)
            {
                await ctx.TriggerTypingAsync();

                await ctx.Message.DeleteAsync();

                Fonksiyonlar.TumHerkesePuanVer(Constants.SQLCONNECTION, miktar);
                await ctx.RespondAsync($"{ctx.Message.Author.Mention} Herkese {miktar} Puan Hediye Etti Yuppii.");
            }
コード例 #4
0
            public async Task puanekle(CommandContext ctx, long miktar, DiscordUser kisi)
            {
                await ctx.TriggerTypingAsync();

                await ctx.Message.DeleteAsync();

                Fonksiyonlar.KullaniciPuanEkle(Constants.SQLCONNECTION, kisi.Id, miktar);
                await ctx.RespondAsync($" {kisi.Mention} Hesabınıza {miktar} Puan Eklendi . Şuan Sahip Olduğunuz Puan : {Fonksiyonlar.KullaniciPuanBul(Constants.SQLCONNECTION, kisi.Id)}");
            }
コード例 #5
0
            public async Task yolla(CommandContext ctx, [Description("Gönderilecek Kullanıcı.")] DiscordUser kisi, long miktar)
            {
                //string chan = (await ctx.Client.GetChannelAsync(ctx.Message.ChannelId)).Name;
                //if (!(chan.StartsWith("bot") || chan.StartsWith("komut"))) return;
                long puan = Fonksiyonlar.KullaniciPuanBul(Constants.SQLCONNECTION, ctx.Message.Author.Id);

                if (puan < miktar)
                {
                    await ctx.RespondAsync($"Üzgünüm {ctx.Message.Author.Mention} Yeterli Puanınız Yok. ");

                    return;
                }

                Fonksiyonlar.KullaniciPuanDegistir(Constants.SQLCONNECTION, ctx.Message.Author.Id, puan - miktar);
                Fonksiyonlar.KullaniciPuanEkle(Constants.SQLCONNECTION, kisi.Id, miktar);
                await ctx.RespondAsync($" {ctx.Message.Author.Mention} => {miktar} => {kisi.Mention} Yolladı . {ctx.Message.Author.Mention}  Kalan Puanınız : {Fonksiyonlar.KullaniciPuanBul(Constants.SQLCONNECTION, ctx.Message.Author.Id)}");
            }
コード例 #6
0
            public async Task siralama(CommandContext ctx)
            {
                //string chan = (await ctx.Client.GetChannelAsync(ctx.Message.ChannelId)).Name;
                //if (!(chan.StartsWith("bot") || chan.StartsWith("komut"))) return;
                await ctx.TriggerTypingAsync();

                Dictionary <ulong, long> users = Fonksiyonlar.PuanSiralamasi(Constants.SQLCONNECTION);

                DiscordEmbedBuilder embedbuilder = new DiscordEmbedBuilder();

                embedbuilder.Description = "Puan Sıralaması";

                int n = 0;

                foreach (var item in users)
                {
                    n++;
                    DiscordUser user = await ctx.Client.GetUserAsync(item.Key);

                    embedbuilder.AddField(n.ToString(), user.Username + item.Value.ToString().PadLeft(32 - user.Username.Length));
                }

                await ctx.RespondAsync("", false, embedbuilder.Build());
            }