#Cannot Get Guild Owner in the on_guild_create event

1 messages · Page 1 of 1 (latest)

mossy bison
#

as a rule of thumb get_* anything means get this thing from the cache

fetch_* means check the cache, if its not there, fetch from the api

in this case your owner user isnt cached, so try await event.guild.fetch_owner()

cold obsidian
#

fetch_owner().id

    print(event.guild.fetch_owner().id)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'coroutine' object has no attribute 'id'

get_owner().user.id

    print(event.guild.get_owner().user.id)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'user'

get_owner().id

    print(event.guild.get_owner().id)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'id'
mossy bison
cold obsidian
#

nvm

mossy bison
#

fetch_owner is a coroutine, you need to await it

cold obsidian
#

i figured it out

#

ye i realized

#

thats for the info tho

#

huge help

mossy bison
#

np

cold obsidian
mossy bison
#

its private, but if you really cant await it guild._owner_id

but im curious, why cant you await it?