Beispiel #1
0
        public static async Task OnCommandExecuted(Discord.Optional <CommandInfo> command, ICommandContext context, IResult result)
        {
            if (!result.IsSuccess)
            {
                if (result.Error == CommandError.UnknownCommand)
                {
                    return;
                }

                var ctx = context as SocketCommandContext;

                EmbedBuilder emb = ctx.CreateEmbed(title: "오류 발생!", description: $"{result.Error}: {result.ErrorReason}\n");

                await ctx.MsgReplyEmbedAsync(emb.Build());
            }
            else
            {
                if (new Random().Next(0, 10) == 0 && await KoreanBots.IsVotedAsync(context.User.Id))
                {
                    await(context as SocketCommandContext).MsgReplyEmbedAsync("[KOREANBOTS](https://koreanbots.dev/bots/495209098929766400)에서 올리브토스트에게 하트를 추가해주세요!\n(하트는 12시간마다 한번씩 추가할 수 있어요)");
                }
            }
        }
Beispiel #2
0
 private static async Task OnReady()
 {
     await KoreanBots.UpdateServerCountAsync(Program.Client.Guilds.Count);
 }
Beispiel #3
0
 private static async Task OnLeftGuild(SocketGuild arg)
 {
     await KoreanBots.UpdateServerCountAsync(Program.Client.Guilds.Count);
 }
Beispiel #4
0
        private static async Task OnJoinGuild(SocketGuild guild)
        {
            await OnGuildAvailable(guild);

            await KoreanBots.UpdateServerCountAsync(Program.Client.Guilds.Count);
        }