A ton of work getting towards dms.

This commit also points to my fork of discordgo which makes it look like the
official client which is the only way to get the actually contents of a dm
when not authorized as a bot.
This commit is contained in:
Gary Kramlich
2022-01-25 23:22:20 -06:00
parent 167fdede1f
commit 680f7bdbea
15 changed files with 478 additions and 57 deletions

View File

@@ -78,7 +78,7 @@ func (mh *matrixHandler) handleMessage(evt *event.Event) {
content.RemoveReplyFallback()
if content.MsgType == event.MsgText {
prefix := mh.bridge.config.Bridge.CommandPrefix
prefix := mh.bridge.Config.Bridge.CommandPrefix
hasPrefix := strings.HasPrefix(content.Body, prefix)
if hasPrefix {
@@ -150,16 +150,16 @@ func (mh *matrixHandler) handleBotInvite(evt *event.Event) {
// Wait to send the welcome message until we're sure we're not in an empty
// room.
mh.sendNoticeWithmarkdown(evt.RoomID, mh.bridge.config.Bridge.ManagementRoomText.Welcome)
mh.sendNoticeWithmarkdown(evt.RoomID, mh.bridge.Config.Bridge.ManagementRoomText.Welcome)
if evt.RoomID == user.ManagementRoom {
if user.HasSession() {
mh.sendNoticeWithmarkdown(evt.RoomID, mh.bridge.config.Bridge.ManagementRoomText.Connected)
mh.sendNoticeWithmarkdown(evt.RoomID, mh.bridge.Config.Bridge.ManagementRoomText.Connected)
} else {
mh.sendNoticeWithmarkdown(evt.RoomID, mh.bridge.config.Bridge.ManagementRoomText.NotConnected)
mh.sendNoticeWithmarkdown(evt.RoomID, mh.bridge.Config.Bridge.ManagementRoomText.NotConnected)
}
additionalHelp := mh.bridge.config.Bridge.ManagementRoomText.AdditionalHelp
additionalHelp := mh.bridge.Config.Bridge.ManagementRoomText.AdditionalHelp
if additionalHelp != "" {
mh.sendNoticeWithmarkdown(evt.RoomID, additionalHelp)
}
@@ -201,8 +201,6 @@ func (mh *matrixHandler) handleMembership(evt *event.Event) {
mh.handlePuppetInvite(evt, user, puppet)
}
mh.log.Warnln("no existing portal for", evt.RoomID)
return
}