« first day (3356 days earlier)      last day (10 days later) » 

12:43 AM
i even posted a question and if possible, please help stackoverflow.com/q/78393432/22108997
 
 
5 hours later…
5:22 AM
1 message moved from Python
 
 
14 hours later…
user22676652
7:35 PM
#announce command
@bot.slash_command(name="announce", description="ping everyone in a server and send a message", guild_id=["1119428346485407744"])
async def announce(ctx, message):
try:
guild = bot.guilds
await guild.text_channels[0].send(f"@everyone {message}")
print(f"Successfully announced: {message}")
except discord.errors.Forbidden as e:
print(f"Bot ran into error while running announce command: {e}")
pass
 
1 message moved from Python
 
user22676652
I ended up getting a trace back from that code:

Traceback (most recent call last):
  File "/home/container/.local/lib/python3.9/site-packages/discord/commands/core.py", line 124, in wrapped
    ret = await coro(arg)
  File "/home/container/.local/lib/python3.9/site-packages/discord/commands/core.py", line 982, in _invoke
    await self.callback(ctx, **kwargs)
  File "/home/container/sheikh-bot.py", line 77, in announce
    await guild.text_channels[0].send(f"@everyone {message}")
AttributeError: 'list' object has no attribute 'text_channels'
 
7:51 PM
I can remove that traceback now?
 
user22676652
Yes
 
user22676652
Sorry for the troubles
 
4 messages moved from Python
 

« first day (3356 days earlier)      last day (10 days later) »