Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating Response always fails by unavailable Guild :/ #39

Open
rapus95 opened this issue Jul 19, 2021 · 1 comment
Open

Creating Response always fails by unavailable Guild :/ #39

rapus95 opened this issue Jul 19, 2021 · 1 comment

Comments

@rapus95
Copy link

rapus95 commented Jul 19, 2021

 Error: Creating response failed
│   time = 2021-07-19T02:51:01.641
│   exception =
│    type UnavailableGuild has no field djl_channels
│    Stacktrace:
│     [1] getproperty(x::Discord.UnavailableGuild, f::Symbol)
│       @ Base .\Base.jl:33
│     [2] put!(s::Discord.State, ch::Discord.DiscordChannel; kwargs::Base.Iterators.Pairs{Symbol, Union{Nothing, UInt64}, NTuple{4, Symbol}, NamedTuple{(:channel, :guild, :message, :user), Tuple{UInt64, Nothing, Nothing, Nothing}}})      
│       @ Discord C:\Users\Aaron\.julia\packages\Discord\S9xlN\src\client\state.jl:256
│     [3] macro expansion
│       @ C:\Users\Aaron\.julia\packages\Setfield\XM37G\src\sugar.jl:182 [inlined]
│     [4] (::Discord.var"#714#716"{Discord.DiscordChannel, Vector{Any}, Discord.Client, Symbol, String, Distributed.Future})()
│       @ Discord C:\Users\Aaron\.julia\packages\Discord\S9xlN\src\rest\rest.jl:197
│     [5] macro expansion
│       @ C:\Users\Aaron\.julia\packages\Discord\S9xlN\src\client\limiter.jl:46 [inlined]
│     [6] (::Discord.var"#574#575"{String, Discord.Limiter, Discord.JobQueue})()
│       @ Discord .\task.jl:411
└ @ Discord C:\Users\Aaron\.julia\packages\Discord\S9xlN\src\rest\rest.jl:204
@rapus95
Copy link
Author

rapus95 commented Jul 19, 2021

function check_admin(client::Client, m::Message)
    guild = Discord.get_guild(client, m.guild_id)
    channel = Discord.get_channel(client, m.channel_id)
    perms = Discord.permissions_in(m.member, Discord.fetchval(guild), Discord.fetchval(channel))
    return Discord.has_permission(perms, PERM_ADMINISTRATOR)
end

that's the code which indirectly leads to that error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant