コード例 #1
0
        public async Task SendWelcomeMsg(SocketGuild arg)
        {
            await Task.Delay(350);

            Modules.BaseCommands _bc = new Modules.BaseCommands();
            if (!DoesExistSettings(arg as IGuild))
            {
                CreateSettings(arg as IGuild);
            }
            if (!DoesExistJson(arg as IGuild))
            {
                CreateJson(arg as IGuild);
            }
            await Task.Delay(150);

            await _bc.SetWelcome_main(arg.TextChannels.OrderBy(c => c.Id).FirstOrDefault() as IMessageChannel);

            EmbedBuilder embed = new EmbedBuilder()
            {
                Author = new EmbedAuthorBuilder()
                {
                    Name    = $"{_client.CurrentUser.Username} joined {arg.Name}!",
                    IconUrl = _client.CurrentUser.GetAvatarUrl()
                },
                Title        = $"{_client.CurrentUser}",
                Description  = $"Bot made by: [Pat](http://daddybot.me/)\nBot made for: [M&D](https://discord.gg/D6qd4BE)\nBot created: {_client.CurrentUser.CreatedAt.Day}/{_client.CurrentUser.CreatedAt.Month}/{_client.CurrentUser.CreatedAt.Year} [D/M/Y]\nType .help for command info",
                ThumbnailUrl = _client.CurrentUser.GetAvatarUrl(),
                Color        = new Color((byte)(_ran.Next(255)), (byte)(_ran.Next(255)), (byte)(_ran.Next(255)))
            };

            await(arg.TextChannels.OrderBy(c => c.Id).FirstOrDefault() as IMessageChannel).SendMessageAsync(string.Empty, false, embed: embed.WithFooter(y => y.WithText(arg.Name)).WithCurrentTimestamp().Build());
            _vMem._run();
        }
コード例 #2
0
ファイル: JSON.cs プロジェクト: Pat-1337/DiscordBot
 public static void DeleteJSON(IGuild guild)
 {
     Ext._vMem _vMem = new Ext._vMem();
     if (File.Exists($@"Settings/settings_{guild.Id}.json"))
     {
         File.Delete($@"Settings/settings_{guild.Id}.json");
     }
     if (File.Exists($@"json/jayson_{guild.Id}.json"))
     {
         File.Delete($@"json/jayson_{guild.Id}.json");
     }
     _vMem._run();
 }