'so everytime i run the command ?trt_train it gives me an error saying non type object has no attribute
getting this weird error for some reason could someone help me with this thanks to anyone who does ive tried various of other things like removing the mention command still doesn't work
@commands.has_role('TRT | Staff Sergeant')
async def trt_train(ctx):
trt = get(ctx.guild.roles, name='Tactical response team')
Channel = get(ctx.guild.channels, name='╚ Training VC #1')
channel = client.get_channel(920385189501358132)
await channel.send(
f'''{trt.mention}
The TRT Command Team are doing Open Recruitments and Trainings for the Tactical Response Team, the elite tactical team within the Bureau of Secret Intelligence.'
INFORMATION
Training FTO:{ctx.author.mention}
VC: {Channel.mention}
Server: 2
Postal: 10013
Time: 40 Minutes
**Please only react with ✔️ IF you are attending!**''')```
getting this error
Traceback (most recent call last):
File "/home/runner/BSI-Bot/venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "main.py", line 84, in trt_train
f'''{TRT.mention}
AttributeError: 'NoneType' object has no attribute 'mention'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
* Serving Flask app '' (lazy loading)
* Environment: production
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
