コード例 #1
0
        public async Task Invite()
        {
            SocketTextChannel stc = this.Context.Channel as SocketTextChannel;

            if (stc != default)
            {
                RestInviteMetadata invite = await stc.CreateInviteAsync(
                    86400,
                    1,
                    false,
                    true);

                await this.Context.DebugPublicReleasePrivate(invite.Url, false);

                await this.Context.Message.AddReactionAsync(new Emoji("👍"));
            }
            else
            {
                await this.Context.Message.AddReactionAsync(new Emoji("❓"));
            }
        }
コード例 #2
0
ファイル: Invite.cs プロジェクト: CodingDab/SavageBot
        public async Task InviteAsync(SocketTextChannel channel, bool temporary = true)
        {
            var invite = await channel.CreateInviteAsync(isTemporary : temporary);

            await ReplyAsync(Context.User.Mention + " here ya go: " + invite.Url);
        }