Ejemplo n.º 1
0
        public static async Task ChangeNickName(DiscordSocketClient client,
                                                SocketCommandContext context)
        {
            // Change Nick Name 💎
            // Get the Home Assistant Server Guild
            ulong serverGuild = (ulong)AppSettingsUtil.AppSettingsLong("serverGuild", true, 330944238910963714);
            var   guild       = client.GetGuild(serverGuild);

            if (null == guild)
            {
                return;
            }

            var user = guild.GetUser(context.User.Id);

            if (user.Nickname.Contains("🔹"))
            {
                await user.ModifyAsync(
                    x => {
                    string newNick = user.Nickname.Replace("🔹", string.Empty);
                    x.Nickname     = newNick;
                }
                    );
            }
        }
Ejemplo n.º 2
0
        public static SocketGuild ServerGuild(SocketCommandContext context)
        {
            ulong serverGuild = (ulong)AppSettingsUtil.AppSettingsLong("serverGuild", true, 330944238910963714);

            return(context.Client.GetGuild(serverGuild));
        }
Ejemplo n.º 3
0
        public static ITextChannel BotSpamChannel(SocketCommandContext context)
        {
            ulong botspamChannelId = (ulong)AppSettingsUtil.AppSettingsLong("botspamChannel", true, 331106174722113548);

            return(context.Client.GetChannel(botspamChannelId) as ITextChannel);
        }
Ejemplo n.º 4
0
        public static ITextChannel ModLogChannel(SocketCommandContext context)
        {
            ulong modlogChannelId = (ulong)AppSettingsUtil.AppSettingsLong("modlogChannel", true, 473590680103419943);

            return(context.Client.GetChannel(modlogChannelId) as ITextChannel);
        }
Ejemplo n.º 5
0
        public static ITextChannel ModChannel(SocketCommandContext context)
        {
            ulong modChannelId = (ulong)AppSettingsUtil.AppSettingsLong("modChannel", true, 330948240805462026);

            return(context.Client.GetChannel(modChannelId) as ITextChannel);
        }