예제 #1
0
async def check_mentions(client: discord.Client, message: discord.Message):
    if len(message.mentions) < 4 and len(message.role_mentions) == 0:
        return

    embed = discord.Embed()
    embed.set_thumbnail(url=message.author.avatar_url) \
        .set_author(name="A message with important notification has been sent.",
                    icon_url="https://cdn4.iconfinder.com/data/icons/infy-interface/300/notification-512.png")
    embed.add_field(name=f'Message by {message.author.display_name}',
                    value=message.content[:1200])

    state, results = api_manager.get_data('servers',
                                          discord_id=message.guild.id)

    if not state:
        return

    log_channel_id = results[0]['discord_log_channel_id']
    log_channel: discord.TextChannel = client.get_channel(log_channel_id)
    main_channel_log = client.get_channel(553974648258166800)

    if log_channel:
        await log_channel.send(embed=embed)

    if main_channel_log:
        embed.set_thumbnail(url=message.guild.icon_url)
        await main_channel_log.send(embed=embed)
예제 #2
0
async def try_mute_on_rejoin(member: discord.Member, db: db_hlapi, client: discord.Client, log: str, ramfs: lexdpyk.ram_filesystem) -> None:

    mute_role_id = db.grab_config("mute-role")
    if mute_role_id and (mute_role := member.guild.get_role(int(mute_role_id))):

        success: bool

        try:
            await member.add_roles(mute_role)
            success = True
        except discord.errors.Forbidden:
            success = False

        stringcases = {
            False: "was not able to be remuted (permissions error)",
            True: "was remuted",
            }

        if log and (channel := client.get_channel(int(log))):
            if isinstance(channel, discord.TextChannel):

                muted_embed = discord.Embed(title=f"Notify on muted member join: {member}", description=f"This user has an entry in the mute database and {stringcases[success]}.")
                muted_embed.color = load_embed_color(member.guild, embed_colors.primary, ramfs)
                muted_embed.set_footer(text=f"uid: {member.id}")

                await catch_logging_error(channel, muted_embed)
예제 #3
0
    async def complete_log(client: discord.Client,
                           sanction_type: str,
                           author: discord.Member or discord.User,
                           guild: discord.Guild,
                           reason: str,
                           image_url: str = ''):
        state, results = api_manager.get_data('servers', discord_id=guild.id)

        if not state:
            return

        log_channel_id = results[0]['discord_log_channel_id']
        log_channel: discord.TextChannel = client.get_channel(log_channel_id)
        embed = EmbedsManager.sanction_embed(sanction_type, guild, reason,
                                             image_url)
        embed.description = f"Sanction by {author.display_name}"

        if log_channel:
            await log_channel.send(embed=embed)

        with open('run/config/config.yml', 'r') as file:
            config = yaml.safe_load(file)

        main_channel_log = client.get_channel(
            config['channels']['log_channel'])
        if main_channel_log:
            embed.set_thumbnail(url=guild.icon_url)
            await main_channel_log.send(embed=embed)
예제 #4
0
 def __init__(self, client: discord.Client):
     self.command = "./logs/command.csv"
     self.ban = "./logs/ban.csv"
     self.client = client
     self.image_channel = client.get_channel(IMAGE_LOG_CHANNEL)
     self.command_channel = client.get_channel(COMMAND_LOG_CHANNEL)
     self.invite_channel = client.get_channel(INVITE_CHANNEL)
예제 #5
0
async def notify_problem(member: discord.Member, ptype: List[str], log: str, client: discord.Client, ramfs: lexdpyk.ram_filesystem) -> None:

    if log and (channel := client.get_channel(int(log))):

        if not isinstance(channel, discord.TextChannel):
            return

        notify_embed = discord.Embed(title=f"Notify on member join: {member}", description=f"Notifying for: {', '.join(ptype)}", color=load_embed_color(member.guild, embed_colors.primary, ramfs))
        notify_embed.set_footer(text=f"uid: {member.id}")

        await catch_logging_error(channel, notify_embed)
예제 #6
0
async def handle_editmessage(message: discord.Message, client: discord.Client,
                             server_data: ServerData):
    channel: discord.TextChannel = message.channel
    author: discord.Member = message.author
    await channel.send(embed=discord.Embed(
        color=discord.Color.gold(),
        description=
        "Ok please send me now the new message and i change it for you"))

    def check(m):
        if m.author.id == author.id and m.channel.id == channel.id:
            return m

    newmessage = await client.wait_for("message", check=check, timeout=None)
    nmsg = newmessage.content
    server_data.ruletext = nmsg
    rules_channel_id = server_data.ruleschannel
    rules_channel = client.get_channel(int(rules_channel_id))
    new_message = await rules_channel.send(embed=discord.Embed(
        color=discord.Color.green(), description=nmsg).set_footer(
            text="Please accept the rules with ✅ or decline them with ❌ "))
    server_data.messageid = new_message.id
    server_data.save()
    db.commit()
    await new_message.add_reaction("✅")
    await new_message.add_reaction("❌")
예제 #7
0
async def handle_deleted_message(conn, client: discord.Client, message_id: int,
                                 message_content: Optional[str], logger: channel_logger.ChannelLogger) -> bool:
    msg = await db.get_message(conn, message_id)
    if not msg:
        return False

    channel = client.get_channel(msg.channel)
    if not channel:
        # Weird edge case, but channel *could* be deleted at this point (can't think of any scenarios it would be tho)
        return False

    await db.delete_message(conn, message_id)
    await logger.log_message_deleted(
        conn,
        channel.guild.id,
        channel.name,
        msg.name,
        msg.hid,
        msg.avatar_url,
        msg.system_name,
        msg.system_hid,
        message_content,
        message_id
    )
    return True
예제 #8
0
async def delete_dispand(
        bot: discord.Client,
        *,
        payload: Optional[discord.RawReactionActionEvent] = None,
        reaction: Optional[discord.Reaction] = None,
        user: Optional[discord.User] = None):
    if payload is not None:
        # when on_raw_reaction_add event
        if str(payload.emoji) != DELETE_REACTION_EMOJI:
            return
        if payload.user_id == bot.user.id:
            return

        channel = bot.get_channel(payload.channel_id)
        message = await channel.fetch_message(payload.message_id)
        await _delete_dispand(bot, message, payload.user_id)
    elif reaction is not None:
        # when on_reaction_add event
        if str(reaction.emoji) != DELETE_REACTION_EMOJI:
            return
        if user.id == bot.user.id:
            return
        await _delete_dispand(bot, reaction.message, user.id)
    else:
        raise ValueError("payload or reaction must be setted")
예제 #9
0
 async def init_discord_target(self,
                               discord_client: discord.Client,
                               first_load=False):
     if isinstance(self.task_dequeue, asyncio.Task):
         return  # already loaded no need to start or check
     c = discord_client.get_channel(self.channel_id)
     if isinstance(c, discord.TextChannel):
         self.discord_channel_obj = c
         self.discord_loaded = True
         self.discord_channel_name = c.name
         self.discord_guild_name = c.guild.name
         self.task_dequeue = asyncio.get_event_loop().create_task(
             self.dequeue_task())
         self.task_cleanup = asyncio.get_event_loop().create_task(
             self.cleanup_task())
     s = "Target Name: {}\nLoaded/Found: {} \nLoaded Channel Name: {}\nLoaded Server Name: {}\nCan Text: {}\n" \
         "Can Embed: {}\nSpam Control Seconds: {}\n".format(self.name, self.discord_loaded,
                                                            self.discord_channel_name, self.discord_guild_name,
                                                            await self.can_message(), await self.can_embed(),
                                                            self.spam_control_seconds)
     if first_load:
         print(s)
     else:
         if isinstance(self.task_dequeue, asyncio.Task):
             print(s)
예제 #10
0
async def do_query_message(conn, client: discord.Client, queryer_id: int,
                           message_id: int, reacted_emoji: str) -> bool:
    # Find the message that was queried
    msg = await db.get_message(conn, message_id)
    if not msg:
        return False

    # Then DM the queryer the message embed
    card = await embeds.message_card(client, msg, include_pronouns=True)
    user = client.get_user(queryer_id)
    if not user:
        # We couldn't find this user in the cache - bail
        return False

    # Remove the original reaction by the user if we have "Manage Messages"
    channel = client.get_channel(msg.channel)
    if isinstance(channel, discord.TextChannel) and channel.permissions_for(
            channel.guild.get_member(client.user.id)).manage_messages:
        # We need the message instance itself to remove the reaction, since discord.py doesn't let you
        # call HTTP endpoints with arbitrary IDs (at least, not without internals-hacking)
        try:
            message_instance = await channel.get_message(message_id)
            member = channel.guild.get_member(queryer_id)
            await message_instance.remove_reaction(reacted_emoji, member)
        except (discord.Forbidden, discord.NotFound):
            # Oh yeah, and this can also fail. yeet.
            pass

    # Send the card to the user
    try:
        await user.send(embed=card)
    except discord.Forbidden:
        # User doesn't have DMs enabled, not much we can do about that
        pass
예제 #11
0
파일: handler.py 프로젝트: TUSB/ROBO-TUSB
async def timer(client: discord.Client, vote_id: str, notify: bool=False):
    t_needed = 0
    while not client.is_closed:
        await asyncio.sleep(60 - t_needed)
        t_start = time.time()
        vote = sqlib.votes.get(vote_id)
        msg_id, options, duration, channel_id = vote
        duration -= 1

        sqlib.votes.update(msg_id, {"duration": duration})
        channel = client.get_channel(channel_id)

        try:
            message = await client.get_message(channel, msg_id)
        except AttributeError:
            print("AttributeError")
            continue

        await refresh_vote_msg(message, json.loads(options), duration, client, notify=notify)

        if duration == 0:
            break

        t_end = time.time()
        t_needed = t_end - t_start
예제 #12
0
파일: sub.py 프로젝트: the-Bruce/ALTANTIS
def sub_from_dict(dictionary : Dict[str, Any], client : discord.Client) -> Submarine:
    """
    Creates a submarine from a serialised dictionary.
    """
    newsub = Submarine("", {}, 0, 0, "")

    # self.channels: turn channel IDs into their objects.
    channels = dictionary["channels"]
    for channel in channels:
        channels[channel] = client.get_channel(channels[channel])
    
    # Subsystems need to be remade into their classes.
    for subsystem in subsystems:
        # First, set the self-reference.
        # newsub.__getattribute__... is the sub link generated by the
        # constructor of Submarine.
        dictionary[subsystem]["sub"] = newsub.__getattribute__(subsystem).sub
        # Then, load in the dictionary (initialising the child class).
        newsub.__getattribute__(subsystem).__dict__ = dictionary[subsystem]
        # Finally, modify the dictionary to contain the actual instantiated
        # subsystem as opposed to the dictionary form.
        dictionary[subsystem] = newsub.__getattribute__(subsystem)

    newsub.__dict__ = dictionary
    return newsub
예제 #13
0
async def send_exception(client: discord.Client, exception: Exception, source_name: str, mention_role: Optional[int] = 820974562770550816, pin: bool = True, timestamp: bool = True):
    """
    sends the exception into a channel if `DATA.debug` ist disabled
    """
    if not DATA.debug:
        super_log: discord.TextChannel = client.get_channel(DATA.IDs.Channels.Super_Log)

        file = discord.File(BytesIO(format_exc().encode()), "exception.log")
        embed: discord.Embed = discord.Embed(title=source_name,
                                             description=f"{exception.__class__.__name__}: {exception.__str__()}\n",
                                             color=discord.Color.magenta())

        message: discord.Message = await super_log.send(embed=embed, file=file)

        if timestamp:
            from discord.utils import snowflake_time
            embed.add_field(name="datetime.datetime",
                            value=snowflake_time(message.id).__str__())
            await message.edit(embed=embed)
        if pin:
            await message.pin()
        if mention_role:
            await super_log.send(f"<@&{mention_role}>")
    else:
        raise exception
예제 #14
0
    async def run(self, message: discord.Message, trigger: str,
                  client: discord.Client):

        if not message.author.id == int(os.environ.get("OWNER_ID")):
            await message.channel.send("This command is meant for others.")
            return

        restorechannelname = message.content[len(trigger):]
        print(restorechannelname)
        # return
        messagelogchannelid = int(os.environ.get("MSG_LOG_CHANNEL_ID"))
        messagelogchannel = client.get_channel(messagelogchannelid)

        async for i in messagelogchannel.history(limit=None,
                                                 oldest_first=True):
            try:
                msgembed = i.embeds[0]
            except:
                print("MESSAGE DIDNT HAVE EMBED")
                print(i.content)
                continue

            titleparse = msgembed.title.split(
                " in ")  # name#0000 in channel in server
            print(titleparse)

            print(titleparse[1] == restorechannelname)
            print(titleparse[2] == message.guild.name)
            if all((titleparse[1] == restorechannelname,
                    titleparse[2] == message.guild.name)):
                await message.channel.send(embed=msgembed
                                           )  # resend the archival message
                print("Restoring!")
예제 #15
0
 def from_dict(client: discord.Client, data):
     return StickyData(channel=client.get_channel(data['channel'])
                       or discord.Object(id=data['channel']),
                       message=data['message'],
                       delay=timedelta(seconds=data['delay']) if data.get(
                           'delay', None) is not None else None,
                       posted_message_id=data.get('posted_message', None))
예제 #16
0
    def bulk_from_config(cls, bot: discord.Client, **entries):

        for uid, data in entries.items():
            cid = data.pop("channel", 0)
            aid = data.pop("author", 0)
            initial_ts = data.pop("initial", 0)
            initial = datetime.fromtimestamp(initial_ts, tz=timezone.utc)
            recur_raw = data.pop("recur", None)
            recur = timedelta(seconds=recur_raw) if recur_raw else None

            channel = cast(Optional[discord.TextChannel], bot.get_channel(cid))
            if not channel:
                continue

            author = channel.guild.get_member(aid)
            if not author:
                continue

            with contextlib.suppress(AttributeError, ValueError):
                yield cls(
                    initial=initial,
                    recur=recur,
                    channel=channel,
                    author=author,
                    uid=uid,
                    **data,
                )
예제 #17
0
파일: twitch.py 프로젝트: EdwardBetts/PCBOT
def on_command(client: discord.Client, message: discord.Message, args: list):
    if args[0] == "!twitch":
        m = "Please see `!help twitch`."
        if len(args) > 1:
            # Assign a twitch channel to your name or remove it
            if args[1] == "set":
                if len(args) > 2:
                    twitch_channel = args[2]
                    twitch_channels.data["channels"][message.author.id] = twitch_channel
                    twitch_channels.save()
                    m = "Set your twitch channel to `{}`.".format(twitch_channel)
                else:
                    if message.author.id in twitch_channels.data["channels"]:
                        twitch_channels.data["channels"].pop(message.author.id)
                        twitch_channels.save()
                        m = "Twitch channel unlinked."

            # Return the member's or another member's twitch channel as a link
            elif args[1] == "get":
                if len(args) > 2:
                    member = client.find_member(message.server, args[2])
                else:
                    member = message.author

                if member:
                    # Send the link if member has set a channel
                    if member.id in twitch_channels.data["channels"]:
                        m = "{}'s twitch channel: https://secure.twitch.tv/{}.".format(
                            member.name,
                            twitch_channels.data["channels"][member.id]
                        )
                    else:
                        m = "No twitch channel assigned to {}!".format(member.name)
                else:
                    m = "Found no such member."

            # Set or get the twitch notify channel
            elif args[1] == "notify-channel":
                if message.author.permissions_in(message.channel).manage_server:
                    if len(args) > 2:
                        channel = client.find_channel(message.server, args[2])

                        if channel:
                            twitch_channels.data["notify-channel"] = channel.id
                            twitch_channels.save()
                            m = "Notify channel set to {}.".format(channel.mention)
                    else:
                        if "notify-channel" in twitch_channels.data:
                            twitch_channel = client.get_channel(twitch_channels.data["notify-channel"])
                            if twitch_channel:
                                m = "Twitch notify channel is {}.".format(twitch_channel)
                            else:
                                m = "The twitch notify channel no longer exists!"
                        else:
                            m = "A twitch notify channel has not been set."
                else:
                    m = "You need `Manage Server` to use this command."

        yield from client.send_message(message.channel, m)
예제 #18
0
async def luProcess(client: discord.Client, reaction, embeds):
  channel = client.get_channel(775659410139643925)
  bis = client.get_channel(798113614531395614)
  check = False
  reactions = reaction.message.reactions
  for reac in reactions:
    if reac.emoji == '✅':
      if reac.count > 1:
        check = True
    if reac.emoji == "❌":
      if reac.count > 1:
        check = False
  if check:
    await channel.send(embed = embeds[0])
    await reaction.message.delete()
    ping = await channel.send(reaction.message.guild.default_role)
    await ping.delete()
예제 #19
0
 def from_dict(bot: discord.Client, data: dict):
     ch = bot.get_channel(data['channel'])
     if ch is None:
         raise ValueError("Invalid channel {!r}".format(data['channel']))
     return WikiChannelData(subreddit=data['subreddit'],
                            wikipage=data['wikipage'],
                            last_revision=data.get('last_revision', 0),
                            channel=ch,
                            messages=data.get('messages', []))
예제 #20
0
async def parse_channel_message_noexcept(
        message: discord.Message, args: list[str],
        client: discord.Client) -> tuple[discord.Message, int]:
    """
    Parse a channel message from a url, #channel messageid, or channelid-messageid field

    :returns: Tuple[discord.Message, int] -- The message and the amount of args the message grabbing took
    :raises: lib_sonnetcommands.CommandError -- The message did not exist or the function had invalid inputs
    """

    if not message.guild:
        raise lib_sonnetcommands.CommandError("ERROR: Not a guild message")

    try:
        message_link = args[0].replace("-", "/").split("/")
        log_channel: Union[str, int] = message_link[-2]
        message_id = message_link[-1]
        nargs = 1
    except IndexError:
        try:
            log_channel = args[0].strip("<#!>")
            message_id = args[1]
            nargs = 2
        except IndexError:
            raise lib_sonnetcommands.CommandError(
                constants.sonnet.error_args.not_enough)

    try:
        log_channel = int(log_channel)
    except ValueError:
        raise lib_sonnetcommands.CommandError(
            constants.sonnet.error_channel.invalid)

    discord_channel = client.get_channel(log_channel)
    if not discord_channel:
        raise lib_sonnetcommands.CommandError(
            constants.sonnet.error_channel.invalid)

    if not isinstance(discord_channel, discord.TextChannel):
        raise lib_sonnetcommands.CommandError(
            constants.sonnet.error_channel.scope)

    if discord_channel.guild.id != message.guild.id:
        raise lib_sonnetcommands.CommandError(
            constants.sonnet.error_channel.scope)

    try:
        discord_message = await discord_channel.fetch_message(int(message_id))
    except (ValueError, discord.errors.HTTPException):
        raise lib_sonnetcommands.CommandError(
            constants.sonnet.error_message.invalid)

    if not discord_message:
        raise lib_sonnetcommands.CommandError(
            constants.sonnet.error_message.invalid)

    return (discord_message, nargs)
예제 #21
0
파일: worker.py 프로젝트: sizumita/Sigma
 def __init__(self, client: discord.Client):
     super().__init__(client)
     self.ch = client.get_channel(BAN_CHANNEL)
     self.guilds = {}
     try:
         with open('./datas/settings.pickle', 'rb') as f:
             self.guilds = pickle.load(f)
     except (FileNotFoundError, EOFError):
         pass
예제 #22
0
async def send_to_keyed_channel(bot: discord.Client,
                                channel: HuskyStatics.ChannelKeys,
                                embed: discord.Embed):
    log_channel = HuskyConfig.get_config().get('specialChannels',
                                               {}).get(channel.value, None)
    if log_channel is not None:
        log_channel: discord.TextChannel = bot.get_channel(log_channel)

        await log_channel.send(embed=embed)
예제 #23
0
    async def error_log(client: discord.Client, error_content: str,
                        guild: discord.Guild):
        state, results = api_manager.get_data('servers', discord_id=guild.id)

        if not state:
            return

        log_channel_id = results[0]['discord_log_channel_id']
        log_channel: discord.TextChannel = client.get_channel(log_channel_id)
        embed = EmbedsManager.error_embed(error_content)

        if log_channel:
            await log_channel.send(embed=embed)

        main_channel_log = client.get_channel(553974648258166800)
        if main_channel_log:
            embed.set_thumbnail(url=guild.icon_url)
            await main_channel_log.send(embed=embed)
예제 #24
0
async def send_to_channels(bot: discord.Client, channel_ids, message: str):
    '''Send message to a list of Discord channels'''
    for channel_id in channel_ids:
        channel = bot.get_channel(channel_id)
        if channel:
            await channel.send(message)
        else:
            invalid_channel_id_message = f'Channel ID {channel_id} appears to be invalid.'
            print(invalid_channel_id_message)
            logging.error(invalid_channel_id_message)
예제 #25
0
파일: worker.py 프로젝트: sizumita/Sigma
    def __init__(self, client: discord.Client):

        super().__init__(client)
        self._last_result = None
        self.r = requests.get(
            "https://ja.wikipedia.org/wiki/Unicode%E3%81%AEEmoji%E3%81%AE%E4%B8%80%E8%A6%A7"
        )
        self.soup = BeautifulSoup(self.r.text, 'lxml')
        self.report = client.get_channel(REPORT_CHANNEL)
        self.notice = client.get_channel(notice_CHANNEL)
예제 #26
0
def send_messages(
    client: discord.Client,
    channel_id: int,
    messages: List[str],
    loop,
):
    channel = client.get_channel(int(channel_id))
    for msg in messages:
        future = asyncio.run_coroutine_threadsafe(channel.send(msg), loop)
        future.result()
예제 #27
0
async def get_message_contents(client: discord.Client, channel_id: int, message_id: int):
    channel = client.get_channel(channel_id)
    if channel:
        try:
            original_message = await channel.get_message(message_id)
            return original_message.content or None
        except (discord.errors.Forbidden, discord.errors.NotFound):
            pass

    return None
예제 #28
0
파일: botutils.py 프로젝트: itisyb/bottry
async def autoyeet_loop_channelid(client: discord.Client, channelid: str):
    channel = client.get_channel(channelid)
    yeetdb = json.loads(REDISDB.get('AUTOYEET').decode())
    yeetdb[channel.id] = True
    REDISDB.set('AUTOYEET', json.dumps(yeetdb))
    while True:
        await asyncio.sleep(random.randint(5, 120))
        yeetdb = json.loads(REDISDB.get('AUTOYEET').decode())
        if not yeetdb[channel.id]:
            break
        await client.send_message(channel, 'YEET!')
예제 #29
0
async def grab_an_adult(discord_message: discord.Message, guild: discord.Guild, client: discord.Client, mconf: Dict[str, Any], ramfs: lexdpyk.ram_filesystem) -> None:

    if mconf["regex-notifier-log"] and (notify_log := client.get_channel(int(mconf["regex-notifier-log"]))):

        if not isinstance(notify_log, discord.TextChannel):
            return

        message_content = generate_reply_field(discord_message)

        # Message has been grabbed, start generating embed
        message_embed = discord.Embed(title=f"Auto Flagged Message in #{discord_message.channel}", description=message_content, color=load_embed_color(guild, embed_colors.primary, ramfs))

        message_embed.set_author(name=str(discord_message.author), icon_url=user_avatar_url(discord_message.author))
        message_embed.timestamp = discord_message.created_at

        # Grab files async
        awaitobjs = [asyncio.create_task(i.to_file()) for i in discord_message.attachments]
        fileobjs = [await i for i in awaitobjs]

        await catch_logging_error(notify_log, message_embed, fileobjs)
예제 #30
0
    async def error_log(client: discord.Client, error_content: str,
                        guild: discord.Guild):
        main_channel_log = client.get_channel(692055209429565498)
        embed = EmbedsManager.error_embed(error_content)
        if main_channel_log:
            if guild is not None:
                embed.set_thumbnail(url=guild.icon_url)
            await main_channel_log.send(embed=embed)
        if guild is None:
            return
        state, results = api_manager.get_data('servers', discord_id=guild.id)

        if not state:
            return

        log_channel_id = results[0]['discord_log_channel_id']
        log_channel: discord.TextChannel = client.get_channel(log_channel_id)

        if log_channel:
            await log_channel.send(embed=embed)
예제 #31
0
async def try_get_channel(channel_id: int,
                          client: discord.Client) -> discord.abc.GuildChannel:
    """Attempt to get or fetch a channel and return it."""
    log.trace(f"Getting the channel {channel_id}.")

    channel = client.get_channel(channel_id)
    if not channel:
        log.debug(f"Channel {channel_id} is not in cache; fetching from API.")
        channel = await client.fetch_channel(channel_id)

    log.trace(f"Channel #{channel} ({channel_id}) retrieved.")
    return channel
예제 #32
0
 def get_voice_channel(self, client: discord.Client) -> discord.Channel:
     channel = client.get_channel(self._voice_channel_id)
     return channel