Skip to content

TabletBot rewrite to poise#23

Merged
InfinityGhost merged 5 commits intoOpenTabletDriver:masterfrom
jamesbt365:poise
Dec 7, 2023
Merged

TabletBot rewrite to poise#23
InfinityGhost merged 5 commits intoOpenTabletDriver:masterfrom
jamesbt365:poise

Conversation

@jamesbt365
Copy link
Copy Markdown
Member

@jamesbt365 jamesbt365 commented Nov 28, 2023

This pull request fixes:

Stuff left to complete in this pull request:

  • Restore Embed Command (and fix it because broken on current TabletBot)
  • Fix code snippet posting (broke it on purpose to satisfy the compiler while I was rewriting)
  • restore and fix edit-snippets (broken on original bot)
  • Pin to 0.12 serenity when new poise release drops.
  • Add track_edits to commands
  • Fix workflow

A lot has changed in serenity since this bot was written, and I decided to go ahead and do a rewrite into poise to allow for more flexibility in commands.

poise allows for hybrid command support which we are using here to restore prefix commands.

Poise however does not allow for getting mutable references to custom data, so snippets now have to be in a synchronization primitive.

Previously commands were accessible in DMs, allowing for anybody to go into DMs and modify snippets regardless of permissions.

Because TabletBot is designed for one guild I haven't locked down the commands to permissions, but I have disabled the commands in DMs in this pull request to prevent this abuse from happening. Permissions will continue to be locked down in the OpenTabletDriver guild.

@jamesbt365 jamesbt365 marked this pull request as draft November 28, 2023 12:47
@jamesbt365 jamesbt365 changed the title Partial TabletBot rewrite to poise TabletBot rewrite to poise Nov 28, 2023
@jamesbt365 jamesbt365 marked this pull request as ready for review November 28, 2023 19:42
@jamesbt365
Copy link
Copy Markdown
Member Author

Other than fixing the workflow it should work just fine.

@jamesbt365
Copy link
Copy Markdown
Member Author

Not even sure how the workflow works or what needs changing but I'll look into it.

@jamesbt365 jamesbt365 force-pushed the poise branch 5 times, most recently from c932849 to f1513e5 Compare November 28, 2023 21:46
@jamesbt365
Copy link
Copy Markdown
Member Author

I have gone ahead and pushed a new flake simply to fix the workflow (it needed newer rust and nix unstable didn't have it).

This probably isn't the best way to do it, as well as it no longer includes the dev shell or the default.nix file. I would prefer if somebody else came up with a proper solution but at this moment I don't have the energy to figure out a better way of doing it.

jamesbt365 and others added 3 commits December 4, 2023 19:37
- Uses serenity 0.12 (poise doesn't have a release targetting it yet)
- Fixes the Nix build action.
- Adds buttons to manipulate issue embeds
- Add issue tokens to allow for linking other repositories
- Add edit-embed support.
@jamesbt365 jamesbt365 force-pushed the poise branch 2 times, most recently from 7babed9 to b0a4ec7 Compare December 5, 2023 23:02
- Fixes missing . in regex for repos
- fix list-repos sending 2 messages
- fix missing url (and url parsing) in embed command
- fix embed command sending 2 responses in certain errors.
- lazily match everywhere due to autocomplete limitations
- remove redundant 25+ snippet warning
@InfinityGhost InfinityGhost added the enhancement New feature or request label Dec 7, 2023
@InfinityGhost
Copy link
Copy Markdown
Member

This pr is big enough, and we've already deployed some revisions of it so I figure we can go ahead and merge this.

@InfinityGhost InfinityGhost merged commit bebdde4 into OpenTabletDriver:master Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

2 participants