Beispiel #1
0
        public async Task Join()
        {
            var user = Context.User as SocketGuildUser;

            if (user.VoiceChannel is null)
            {
                await ReplyAsync("You need to connect to a voice channel.");

                return;
            }
            else
            {
                await _musicService.ConnectAsync(Context.Guild, user.VoiceState, Context.Channel as ITextChannel);
                await ReplyAsync($"now connected to {user.VoiceChannel.Name}");
            }
        }
Beispiel #2
0
        public async Task Join()
        {
            if (Context.Channel is IDMChannel)
            {
                return;
            }
            SocketGuildUser user = Context.User as SocketGuildUser;

            if (user.VoiceChannel == null)
            {
                await ReplyAsync(":x: Not connected to a voice channel.");

                return;
            }
            SocketGuildUser bot = Constants.IConversions.GuildUser(Context);

            if (bot.VoiceChannel != null)
            {
                await ReplyAsync($":x: Already connected to {bot.VoiceChannel.Name}.");

                return;
            }

            await ReplyAsync($":ok: Connected to {user.VoiceChannel.Name}.");

            await _musicService.ConnectAsync(user.VoiceChannel, Context.Channel as SocketTextChannel);
        }
Beispiel #3
0
        public async Task PlayAsync([Remainder] string query)
        {
            string[] args    = Context.Message.Content.Split(" ");
            ulong    userId  = Context.Message.Author.Id;
            ulong    guildId = Context.Guild.Id;
            var      embed   = new EmbedBuilder();

            var user        = Context.User as SocketGuildUser;
            var textChannel = Context.Channel as ITextChannel;

            if (user.VoiceChannel == null)
            {
                await textChannel.TriggerTypingAsync();

                embed.WithDescription("You are not connected to a voice channel!");
                await ReplyAsync(null, false, embed.Build());
            }
            else
            {
                await textChannel.TriggerTypingAsync();

                await _musicService.ConnectAsync(user.VoiceChannel, textChannel);

                await textChannel.TriggerTypingAsync();
                await ReplyAsync(null, false, await _musicService.PlayAsync(query, Context.Guild.Id));
            }
        }
Beispiel #4
0
        public async Task Join()
        {
            var user = Context.User as SocketGuildUser;

            if (user is null)
            {
                await ReplyAsync("User not found.");

                return;
            }

            if (user.VoiceChannel is null)
            {
                await ReplyAsync("You need to connect to a voice channel.");

                return;
            }

            await _musicService.ConnectAsync(user.VoiceChannel, Context.Channel as ITextChannel);

            if (user.VoiceChannel.Id == 693885456663838850)
            {
                await ReplyAsync($"Disappeared");
            }
            else
            {
                await ReplyAsync($"now connected to {user.VoiceChannel.Name}");
            }
        }
Beispiel #5
0
        private async Task Join()
        {
            //if (!_musicService.HasMusicPrivilege(Context)) return;
            if (_musicService.NodeHasPlayer(Context.Guild))
            {
                await ReplyAsync("I'm already connected to a voice channel!");

                return;
            }

            var user = Context.User as SocketGuildUser;

            if (user?.VoiceChannel is null)
            {
                await ReplyAsync("You need to connect to a voice channel!");

                return;
            }
            else
            {
                try
                {
                    await _musicService.ConnectAsync(user.VoiceChannel, Context.Channel as ITextChannel);
                    await ReplyAsync($"Now Connected to {user.VoiceChannel.Name}!");

                    Util.Log($"MUSIC: Joined {user.VoiceChannel.Name} on server {user.Guild.Name}");
                }
                catch (Exception e)
                {
                    await ReplyAsync(e.Message);
                }
            }
        }
Beispiel #6
0
        public async Task Plasy([Remainder] string query)
        {
            var user = Context.User as SocketGuildUser;

            if (user.VoiceChannel is null)
            {
                await ReplyAsync("надо быть в войсе дурачок");

                return;
            }
            else
            {
                await _musicService.ConnectAsync(user.VoiceChannel, Context.Channel as ITextChannel);
            }
            await ReplyAsync(await _musicService.PlayAsync(query, Context.Guild.Id));
        }
Beispiel #7
0
        public async Task JoinAsync()
        {
            var embed = new EmbedBuilder();

            var user        = Context.User as SocketGuildUser;
            var textChannel = Context.Channel as ITextChannel;
            await textChannel.TriggerTypingAsync();

            if (user.VoiceChannel == null)
            {
                embed.WithDescription("You are not connected to a voice channel!");
                await ReplyAsync(null, false, embed.Build());
            }
            else
            {
                embed.WithDescription($"Now connected to: {user.VoiceChannel.Name}");
                await ReplyAsync(null, false, embed.Build());

                await _musicService.ConnectAsync(user.VoiceChannel, textChannel);
            }
        }
Beispiel #8
0
        public async Task Join()
        {
            var user = Context.User as SocketGuildUser;

            if (user.VoiceChannel is null)
            {
                var builder = new EmbedBuilder()
                {
                    Color       = new Color(189, 16, 224),
                    Description = $"```You need to connect to a voice channel.```",
                    Title       = "Command"
                };
                builder.WithCurrentTimestamp();
                var Auther = new EmbedAuthorBuilder()
                             .WithName("Area51 Commander")
                             .WithIconUrl("https://i.imgur.com/xqfHEin.png");
                builder.WithAuthor(Auther);
                await ReplyAsync("", false, builder.Build());

                return;
            }
            else
            {
                var builder = new EmbedBuilder()
                {
                    Color       = new Color(189, 16, 224),
                    Description = $"```Now connected to {user.VoiceChannel.Name}```",
                    Title       = "Command"
                };
                builder.WithCurrentTimestamp();
                var Auther = new EmbedAuthorBuilder()
                             .WithName("Area51 Commander")
                             .WithIconUrl("https://i.imgur.com/xqfHEin.png");
                builder.WithAuthor(Auther);
                await _musicService.ConnectAsync(user.VoiceChannel, Context.Channel as ITextChannel);
                await ReplyAsync("", false, builder.Build());
            }
        }