Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I set the status to idle, but it doesn't show up. #9475

Open
3 tasks done
Nooooooo-0328 opened this issue Jun 30, 2023 · 5 comments
Open
3 tasks done

I set the status to idle, but it doesn't show up. #9475

Nooooooo-0328 opened this issue Jun 30, 2023 · 5 comments
Labels
unconfirmed bug A bug report that needs triaging

Comments

@Nooooooo-0328
Copy link

Nooooooo-0328 commented Jun 30, 2023

Summary

First, the status is Live (Twitch).Then try to change the status to idle using a slash command.However, it doesn't change easily.That's why I gave you a serious report that it might be a bug.

Reproduction Steps

  1. Start with Twitch status
    2.Try to change status to idle using slash command

Minimal Reproducible Code

@client.event
async def on_ready():

  await client.change_presence(activity = discord.Streaming(name=f"{Server_name}を覗いています...👀", url="https://www.twitch.tv/Nooooooo_0328"))

@tree.command(name="maintenance",description=f"{Bot_name}をメンテナンスモードに切り替えます (関係者専用)")
async def maintenance(interaction: discord.Interaction):

  if interaction.user.id in adimn_User:
    guild = client.get_guild(Server_id)
    member = guild.get_member(Bot_id)
    if member.status == discord.Status.idle:
      embed=discord.Embed(
        title="メンテナンスモードに切り替えが出来ませんでした。",
        color=Bot_color_warning,
        timestamp=interaction.created_at
      )
      embed.add_field(
        name="エラーの原因",
        value="メンテナンスモード中のため"
      )
      embed.set_author(name="❗ エラー")
      await interaction.response.send_message(embed=embed, ephemeral=True)
      return

    await client.change_presence(status = discord.Status.idle, activity = discord.Activity(name="メンテナンス中...", type=discord.ActivityType.playing))

Expected Results

I thought I could do it, but I couldn't

Actual Results

There were no errors and it didn't take effect no matter how long I waited

Intents

intents = discord.Intents.default() intents.message_content = True intents.moderation = True intents.members = True intents.guilds = True intents.typing = True intents.presences = True intents.voice_states = True

System Information

  • Python v3.11.1-final
  • discord.py v2.2.3-final
  • aiohttp v3.8.4
  • system info: Windows 10 10.0.19045

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

@Nooooooo-0328 Nooooooo-0328 added the unconfirmed bug A bug report that needs triaging label Jun 30, 2023
@Nooooooo-0328
Copy link
Author

I corrected it because it was written in Japanese.

@Nooooooo-0328 Nooooooo-0328 changed the title ステータスをアイドルに設定しましたが、表示されません。 I set the status to idle, but it doesn't show up. Jun 30, 2023
@scrazzz
Copy link
Contributor

scrazzz commented Jul 1, 2023

First of all, you shouldn't be using client.change_presence() in on_ready(), because it triggers multiple times as per the docs.

Instead set the activity and status kwargs in the constructor of your client like so:

client = commands.Bot(command_prefix="!", activity=..., status=...)

You may then try to change your presence using change_presence() on your command.

Note
It may take a few minutes to update the presence.

@itswilliboy
Copy link
Contributor

First of all, you shouldn't be using client.change_presence(), because it triggers multiple times as per the docs.

on_ready may trigger multiple times, not client.change_presence(). If you're calling client.change_presence() in on_ready, it may trigger more than once though.

@Iqrar99
Copy link

Iqrar99 commented Oct 3, 2023

I would recommend you change the presence once the on_connect() event is triggered on the first time the bot is alive. @Nooooooo-0328

@No767
Copy link

No767 commented Oct 3, 2023

I would recommend you change the presence once the on_connect() event is triggered on the first time the bot is alive. @Nooooooo-0328

on_connect suffers from the exact same issue as on_ready @Iqrar99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed bug A bug report that needs triaging
Projects
None yet
Development

No branches or pull requests

5 participants