Example #1
0
        private async Task CreateLFGPost(SocketTextChannel textChnl, SocketVoiceChannel voiceChnl, SocketGuildUser user, string prefix, string text = "")
        {
            var embed       = new EmbedBuilder();
            var embedFooter = new EmbedFooterBuilder();

            embedFooter.Text = "Type " + prefix + "lfg message";

            var inviteURL   = (await voiceChnl.CreateInviteAsync()).Url;
            var title       = $"{voiceChnl.Name} - {voiceChnl.Users.Count()}/{voiceChnl.UserLimit} ";
            var description = "";

            foreach (var a in voiceChnl.Users)
            {
                if (description != "")
                {
                    description += ", ";
                }

                description += a.Mention;
            }

            if (text != "")
            {
                if (text.Count() <= 50)
                {
                    description += "\n" + text + "";
                }
                else
                {
                    description += "\ndescription was to long";
                }
            }


            description += $"\n\n[**Quick Link to " + voiceChnl.Name + "**](" + inviteURL + ")";

            var imageURL = user.GetAvatarUrl();

            embed.WithTitle(title)
            .WithDescription(description)
            .WithThumbnailUrl(imageURL)
            .WithFooter(embedFooter);

            await BuildEmbed(embed, textChnl);
        }
Example #2
0
 public async Task <IInviteMetadata> createActivity(ulong id, SocketVoiceChannel vc)
 {
     return(await vc.CreateInviteAsync(applicationId : id));
 }
Example #3
0
 public Embed IsUsing(SocketVoiceChannel voiceChannel)
 {
     embedBuilder.Color       = Color.Blue;
     embedBuilder.Description = $"Бот уже находится в голосовом канале [{voiceChannel.Name}]({voiceChannel.CreateInviteAsync().Result.Url}).";
     return(embedBuilder.Build());
 }
Example #4
0
 public virtual Task <IInviteMetadata> CreateInviteAsync(int?maxAge = 86400, int?maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions?options = null)
 {
     return(_socketVoiceChannel.CreateInviteAsync(maxAge, maxUses, isTemporary, isUnique, options));
 }