-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Updated Discord Bot Code #393
base: main
Are you sure you want to change the base?
Conversation
Removed any references I could find restricting the discord bot to a specific channel. I swapped it to utilize slash (/) commands and operate under a user installed bot rather than a guild installed bot. Discord has this as an official option when creating a bot and I felt having to have an entire server dedicated for a single bot was unnecessary so now it can be used anywhere at all. All messages are sent with ephemeral set to true if not in DMs with the bot so the bot commands can be executed in literally any server or in a DM with the bot itself and nobody else can see it. If commands are executed in a server, responses for holdings and transactions are DMed to you by the bot instead of sent in the server, even though ephemeral would be set to true so they would be hidden I felt it'd be better to have it in DMs either way. Holdings command is tested and working, Transactions command should function just as normal but have not fully tested since the market is closed. I did try it and it returned errors properly about what ticker I chose, the quantity, and the broker, but it would be worth testing again while the market is open before fully releasing. Dry is set to a default of True for transaction commands unless overrode during executing the command.
Update from main branch
Wow, thanks for the PR! If this requires changes to the setup instructions ( |
Updated guides and example env file Added a /dm command to start a dm with the bot if needed Removed unused DISCORD_CHANNEL variable from example env Added dry default state to env file so it can be defaulted to whatever the user wants (DISCORD BOT ONLY)
Trimmed leftover whitespace Removed unused imports Adjusted line spacing
Removed default dry toggle Ping command now dms user so no need for /dm
This has been working well for me, would love some input from @ImNotOssy @matthew55 Since it changes a lot we definitely want some thorough testing. |
will doo, i had already implemented something like this into my own custom bot but decided against pushing a pull request since "users dont like slash commands" or something idk what nelson had said about it. Over all great ideas, i will look more into what features have been added. |
This looks good to me, I'd love some of your thoughts @matthew55 |
Wow, fantastic PR! Looks good so far and haven't had any noticeable issues. |
Removed any references I could find restricting the discord bot to a specific channel.
I swapped it to utilize slash (/) commands and operate under a user installed bot rather than a guild installed bot. Discord has this as an official option when creating a bot and I felt having to have an entire server dedicated for a single bot was unnecessary so now it can be used anywhere at all.
All messages are sent with ephemeral set to true if not in DMs with the bot so the bot commands can be executed in literally any server or in a DM with the bot itself and nobody else can see it. If commands are executed in a server, responses for holdings and transactions are DMed to you by the bot instead of sent in the server, even though ephemeral would be set to true so they would be hidden I felt it'd be better to have it in DMs either way.
Holdings command is tested and working, Transactions command should function just as normal but have not fully tested since the market is closed. I did try it and it returned errors properly about what ticker I chose, the quantity, and the broker, but it would be worth testing again while the market is open before fully releasing.
Dry is set to a default of True for transaction commands unless overrode during executing the command.