148 Replies
whats wrong
that^
what
channel is not null but it returns prematurely
but doesnt touch the actual return;
ur on ridewr?
correct
igh sick run w debugger
and hover over the variable for me
its on lol
It's really hard to say what's wrong by just seeing 3 lines of code
can u hover over the var and show me what the values are
now, why do you think im saying its not null?
@new FuckPremiumBots() have you considered this
PHP: Hypertext Preprocessor
PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.
f10
...why
this is not a helpful suggestion
wat.
see what it says
ah
ok
im guessing you are using discord.net right?
yes
GitHub
GitHub - discord-php/DiscordPHP: An API to interact with the popula...
An API to interact with the popular messaging app Discord - GitHub - discord-php/DiscordPHP: An API to interact with the popular messaging app Discord
@new FuckPremiumBots() it could be that its failing to fetch the channel
heres a better alternative
are you trying to speedrun a ban?
how
here
im literally giving it the channel
yes but discord is weird
had the same issue in py
uhm can you try to run w/o debugger
the method thats calling it
ok
oh finally a whole block of code
almost blinded myself looking at that
you aint gonna have no future if you keep being an attention seeking brat
let alone 1future
just ignore
that code block doesn't look like the bug you experienced
ik, just had to get that out
ask chat gpt to optimize it
ik, thats whats caling the method
sec
this all stems from a previous jank issue lol
it could be hitting any of those returns
where for some reason channel was null
yes
like i said
but
that was only socket
it could be failing to fetch it as a fallback value
rest returns it fine
missing intent
most likley
nope
weird
all intents on and configured
debug after that line
see the value of channel
that code is long changed, channel is null becausse its null for some reason
despite not being null in the calling method
why would you send old code
^
do you have a bug or not
yes
can you like stop
maybe
...
just report and move on
im sending better code
channel is NOT null here so im confused af
@new FuckPremiumBots() im thinking it could be race contition related
oh boy thats fun
because if ur doing an async operation then its failing to fetch it in time
then its ffailing on the if statement
definitely possible
because when you run it thru debugger it worked
lovely
what could the race condition be tho
it wouldnt make sense tho
cuz ur awaiting it
the async methods dont run
since i give the values
and they arent null
on debugger
can u check
yeah
wait u did
nvm
thats why channel isnt null
im losing braincells trying to figure this out lmao
write ITextChannel?
even with IGuild
yes
im pretty sure thats the issue
why would that be an issue
isnt nullable
and over c# 8 thats an issue
it is you mean
put a ?
yes
ITextChannel? inputChannel = null
in which case it shouldnt matter because i do the same with my commands and it doesnt have an issue
just try it see what it does
alr
if not what u can also do
there should be a nullable over ride method HasValue when you make it nullable
so set it to what i said above and then check
if(inputChannel.HasValue)
same with inputchannel
ignore that then
but ud put that on the if statement
running it with ? still makes it stop
not the assignment
oh
1s
wait
?
nvm
r u sure its failing at that point w/o debugger
yes
i can add console logs 🤷♂️
yes, would be good
i feel like they might have over ridden the is operator
and its doing some more bs
lets see
Blud is discord support
for FREE
wat.
this makes no fucking sense
yh was right then
its failing somewhere down the line
but then
this would have stopped it
i put a debug marker there too
!ban @1ftr trolling
wat.
try putting logs line by line tbf, then you ll haev a betetr idea
ch wouldnt error
thats just assignment
its just null
ofc it wouldnt but it would at least stop
right?
nah
is just an empty assignment
no reason to stop
press f11
ok so it turns out im just a moron got it
prolly this
weird
idk what this method does but could be this?
but ye
it ssomewhere there
heard this and have been using it ever since:
To avoid these problems, we can use ConfigureAwait(false) to tell await not to capture and resume on the current context, but instead resume on any available thread. This can improve performance, scalability and avoid deadlocks in some scenarios
It's only really useful in old .NET Framework and in libraries
ah
got it
I don't think it does anything useful since Core
Try yeeting it all and see what happens
trying
yknow im a massive moron sometimes
ok yeah it doesnt fail there
so far so good
btw just for future reference
try doing what i do
?
sec i ll give context
so when u have an error dont just do an empty return
try to atleast log it
makes ur life x1000 easier
yeah
also i just realized the dumb i did lel
what was wrong
before i fixed it, this was just checkking is null
and of course, it was just see if that fixes it lel
it did not, bug hunting time
and fixed it
kek
thx guys for guiding me through my stupidity
its been a day today
nws nws
happens
currently im loosing my shit too over a ticket below you so
lolol
good luck
it still does the same thing
it doesn't use the active sync context to schedule the continuation
for example, in a GUI app @ZZZZZZZZZZZZZZZZZZZZZZZZZ
in the case of a discord bot, you probably don't have a sync context, so it won't affect anything either way
Didn't something change about it with Core?
Stephen Toub - MSFT
.NET Blog
ConfigureAwait FAQ - .NET Blog
.NET added async/await to the languages and libraries over seven years ago. In that time, it’s caught on like wildfire, not only across the .NET ecosystem, but also being replicated in a myriad of other languages and frameworks. It’s also seen a ton of improvements in .NET,
not how it works fundamentally
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.