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

have puppet do deletions, if present #220

Merged
merged 2 commits into from Sep 10, 2018

Conversation

Projects
None yet
2 participants
@Sorunome
Copy link
Collaborator

commented Aug 1, 2018

Problem: If the matrix link bot on the discord side lacks the "manage messages" permissions, it is impossible to relay redacts over

While the PR doesn't solve that completely, if you have a puppeted account, it will delete the message via the puppet, and as you are allowed to delete your own messages that will still work

@Half-Shot
Copy link
Owner

left a comment

Otherwise, this looks good

src/bot.ts Outdated
if (!storeEvent.Result) {
log.warn(`Could not redact because the event was not in the store.`);
return;
}
log.info(`Redact event matched ${storeEvent.ResultCount} entries`);
while (storeEvent.Next()) {
log.info(`Deleting discord msg ${storeEvent.DiscordId}`);

This comment has been minimized.

Copy link
@Half-Shot

Half-Shot Aug 1, 2018

Owner

MY BEAUTIFUL LOG LINES, REMOVED?!?
(please bring them back ;.;)

This comment has been minimized.

Copy link
@Sorunome

Sorunome Aug 1, 2018

Author Collaborator

woooops i didn't see that one

const channel = <Discord.TextChannel> this.bot.guilds.get(storeEvent.GuildId)
.channels.get(storeEvent.ChannelId);
const msg = await channel.fetchMessage(storeEvent.DiscordId);
const result = await this.LookupRoom(storeEvent.GuildId, storeEvent.ChannelId, event.sender);

This comment has been minimized.

Copy link
@Half-Shot

Half-Shot Aug 1, 2018

Owner

What happens is this fails, should we report it?

This comment has been minimized.

Copy link
@Sorunome

Sorunome Aug 1, 2018

Author Collaborator

That already catches and falls back to the normal bot within that function, so i don't think it is needed

@Half-Shot Half-Shot merged commit dd8c4fb into develop Sep 10, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@Sorunome Sorunome deleted the soru/redactions branch Nov 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.