-
Notifications
You must be signed in to change notification settings - Fork 28
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
new discord bot #45
base: master
Are you sure you want to change the base?
new discord bot #45
Conversation
…to the discordbot
It should not log these messages, in the default case where there is no SmoOnlineServer/Server/DiscordBot.cs Line 35 in a5b8348
SmoOnlineServer/Server/DiscordBot.cs Line 64 in a5b8348
I'm not a big fan of it, but maybe we should introduce a |
should be good now. lmk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the bot for a few minutes and it seems to work.
Will need to do a longer test for a few days though.
I'll test this build for RCL 3
.
} catch (Exception e) { | ||
Logger.Error($"Failed to get log channel \"{Config.LogChannel}\""); | ||
Logger.Error(e); | ||
string message = a.Message ?? string.Empty + (a.Exception != null ? "Exception: " + a.Exception.ToString() : ""); //TODO: this crashes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still an open TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's been so long I can't remember.
disable the discord table by default Co-authored-by: Robin C. Ladiges <[email protected]>
remove redundant warnings messages Co-authored-by: Robin C. Ladiges <[email protected]>
Looks fine to me.
Note that this branch is in conflict with the current |
@Istador is the
thing known to be broken with the new bot as of now vs the old bot as of two years ago, or broken with the new bot as of now vs the old bot as of now? I wonder if the library I'm using is using a newer api version or something with stricter ratelimiting or something. I don't think I'd be doing much more work than the old bot
Is this problem referring to a error in the old bot or the new bot? Also, I've been very busy lately, it's possible that I can't put any significant time into fixing any of this for a few months at least. It's been so long I can't really remember the conversation I had with sanae about why I felt redoing the bot code was a good idea. If you, or someone else, wants to take what I've done and clean it up/redo it/throw it away, that's fine with me. |
The With the old bot Discord just accepted that and allowed that flooding of messages (or they were silently rejected without me noticing). Now with the new bot the rate limit warning is appearing. (Speculation:) I also assume that's because the new bot is using a different API that has stricter rate limiting. Maybe we could implement something to prevent duplicate messages. E.g. don't deliver messages that repeat more often than two times directly after another within a given timeframe. For that we could keep the last two send messages and their timestamps in memory. |
Hitting such a rate limit will eventually lead to an Cloudflare IP address ban (also affecting the Discord desktop client). During that time the server can't be (re)started, it hangs after the |
|
this pr has a feature where you can define certain message prefixes, and if any message begins with that prefix, it doesn't get printed. There are certain messages that are "innocuous", but annoying. I'm still not really sure why some of these errors occur. |
I'm aware of that feature but am not a fan of hiding them completely. Rather I'd see these error being catched in the code and handled in some way (or if they are really innocuous, ignore them there in the code instead of in the logger), because they are still logged to the standard output of the application (server log). In this case I still want to see the |
This is a proposed solution to this bug
by switching to the Discord.net library instead of DiscordSharpPlus
initial testing seems to be fine, some tweaks and fixes will need to be made.