The variable generalchannel is a discord channel i got with client.get_channel(id), this part works, because i can send messages to it
I tried to make an invite to the channel but that doesn't work
Code
link = await generalchannel.create_invite(max_age=25200, max_uses=1)
print(link)
Expected Results
It's supposed to print the link (i'm pretty sure this part works when i try it on an actual bot)
Actual Results
Ignoring exception in on_ready
Traceback (most recent call last):
File "main.py", line 294, in on_ready
link = await generalchannel.create_invite(max_age=25200, max_uses=1)
File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\abc.py", line 881, in create_invite
return Invite.from_incomplete(data=data, state=self._state)
File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\invite.py", line 316, in from_incomplete
guild_id = int(data['guild']['id'])
TypeError: string indices must be integers
System Information
Python v3.8.0-final
discord.py v1.7.3-final
aiohttp v3.7.4.post0
system info: Windows 10 10.0.19041
Checklist
[X] I have searched the open issues for duplicates.
[X] I have shared the entire traceback.
[X] I am using a user token (and it isn't visible in the code).
Summary
When i try to create an invite it gives an error
Reproduction Steps
The variable generalchannel is a discord channel i got with client.get_channel(id), this part works, because i can send messages to it
I tried to make an invite to the channel but that doesn't work
Code
Expected Results
It's supposed to print the link (i'm pretty sure this part works when i try it on an actual bot)
Actual Results
Ignoring exception in on_ready Traceback (most recent call last): File "main.py", line 294, in on_ready link = await generalchannel.create_invite(max_age=25200, max_uses=1) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\abc.py", line 881, in create_invite return Invite.from_incomplete(data=data, state=self._state) File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\invite.py", line 316, in from_incomplete guild_id = int(data['guild']['id']) TypeError: string indices must be integers
System Information
Checklist
Additional Information
I'm pretty sure this works on a bot account.