Closed TigranKhachatryan0 closed 3 years ago
It's worth noting that whenever str(i.owner)=="None#0"
, one can get the wanted result by doing the following dirty and slow (at least for me) profile "hack":
if str(i.owner) == "None#0":
UserProfile=await bot.fetch_user_profile(i.owner.id)
print(str(UserProfile.user))
Reminds me of LazyUser
s when trying to fetch buddy list (known bug, right? doesn't really matter since you're getting rid of them in the next release), but these are Member
s (when "None#0", of course)... Otherwise i.owner is None
async def testing_command():
for i in client.guilds:
if i.member_count>10:
if not(str(i.owner) == str(client.user)):
UserProfile=await client.fetch_user_profile(i.owner_id)
print(str(UserProfile.user))
Okay, this is working. But still, just like the buddy list, this is slow to load.
Github Copilot recommended this method to me, and it actually returns the server owner ID, just use fetch_user_profile to get their information.
This test was done on a considerably large server (50,000 members)
Unfortunately, Discord just doesn't really provide this information seperately. The next version will have a method to subscribe to a guild's member list, which will include the guild owner if they are not offline.
I noticed that this information isn't always provided to bots, either (i.e. you need the members intent). So, this is working as intended.