Discord Bot Construction Kit 🤖

Whoops, I deleted the wrong link from the OP. (There were two plugins, I should have deleted the OAuth one, but instead I deleted the link to the bot!)

Uninstall that plugin asap, as Core now supports Discord OAuth out of the box.

The bot plugin is THIS one:

I’ve altered the OP accordingly, sorry about that!!

「いいね!」 3

Do we know what the status might be of us getting this plugin to automatically update users at the time of their group joining instead of manually syncing? And potentially a way to tell it what groups/roles to sync together instead of it taking over / creating the roles itself?

「いいね!」 2

First time that’s been requested so as you might imagine, it’s not even in backlog as it were.

That would be quite tricky as the bot runs on a discrete thread. You’d have to add a method to message the bot and ensure it’s listening for the request. An interesting exercise technically but not trivial.

Alternatively it might be better to explore a direct API call alternative instead of using the bot. Then you have to decide whether that warrants delivery in a different plugin based on discrete calls, not a bot.

That’s a not a bad idea but why do you need them to be different out of interest?

This is more practical.

PR accepted. Unfortunately my time is very limited to work on significant features without funding.

「いいね!」 3

Well as it is now, it appears to base the roles off of the “name” instead of the title. Which means my roles on discord end up having dashing and no spaces for example. So I suppose an alternative solution is to have it base the roles not on the name but instead the full name, or default title.

That said, there are potentially groups on discourse that I would not want it to sync at all to discord.

Appreciate the responses :slight_smile:

「いいね!」 2

This is on purpose to avoid keying off a description field which can:

a) have spaces in it
b) not be unique

(and is usually a terrible idea in computer science)

However, if there is a safe way of improving this I’m all ears. I appreciate it doesn’t ‘look’ very nice :slight_smile:

The plugin could definitely have additional functionality added to turn sync off for specific groups, at the admin’s discretion. PR accepted.

「いいね!」 4

Could we have the bot auto sync at a scheduled time in the meantime while an API method is explored? Something like, check once every hour, or 24, etc ?

「いいね!」 1

I believe it would be possible to add ‘repeat this again after x hours’ like functionality no problem.

The problem with that though is that will stop every time the bot goes down (e.g. on a reboot).

The absolute best approach would be to either:

a) add a discrete API call connected to a sidekiq job to this plugin OR
b) write a new plugin that used normal API calls instead of utilising a bot (and incorporate a batch sync in that).

Either of those things are going to need sponsorship or a PR.

「いいね!」 1

Fair enough. Thanks for the help.

「いいね!」 2

こんにちは。

現在、あなたのプラグインを使用しており、実用的なレベルまで設定を完了しています。とても素晴らしい機能で、お疲れ様です!

ただし、いくつか質問があります。すべてが動作するようになった今、ユーザーに Discord OAuth 経由でのログインを必要としています。これにより、新しいアカウントが作成されてしまいます。

これを管理するための最良の方法は何でしょうか?新しいアカウントと既存のアカウントをマージする必要がありますか?管理者アカウントで試してみましたが、手動で !discsync を実行しようとした際に「コマンド discsync を実行する権限がありません」というエラーが表示されました。

また、Discourse からロールがまだ 1 つもコピーされていません。

参考までに、私の Discord アカウントはオプション画面で「関連付けられたアカウント」として表示されています。

お手伝いいただき、ありがとうございます!

「いいね!」 2

プラグインにご興味を持っていただきありがとうございます!

これはプラグインの機能ではなく、コア機能です。Discord OAuth は Discourse にデフォルトで搭載されています。

上記の設定は、このプラグインを Discourse に追加したかどうかに関わらず表示されます。

ソーシャルアカウントでログインする場合、登録時のメールアドレスが一致していれば、アカウントは認識され、新しいアカウントは作成されません。ただし、ユーザーが Discord と Discourse で異なるメールアドレスを使用している場合、同じユーザーであることを判別する方法がないため、新しいアカウントが作成されてしまいます。

Discord サーバー上の管理アカウントのことでしょうか?また、ボットを承認しましたか?

Ping! の結果はどうなっていますか?

「いいね!」 4

その通りです。最悪の場合、一致しないメールアドレスを持つアカウントをマージするだけです。

はい、その通りです。Discord インスタンスと Discourse インスタンスの両方の所有者です。“Ping!” の結果は “Pong!” です。Discourse から Discord へロールは移行されていません。

ボットは私の Discord サーバーに存在し、管理者権限を持っています。「承認」とはどういう意味でしょうか?

「いいね!」 3

この手順は完了しましたか?(すべての前提条件を確認しているだけです。おそらくすでに完了されていると思いますが)

「いいね!」 2

ええ、あります :slight_smile:

「いいね!」 1

私の直感では、Discord サーバーにおけるあなたの権限またはボットの権限が何らかの理由で正しく設定されていないようです。私は現在数十個のプラグインを扱っており、このプラグインについても思い出を新たにするために確認しています。このプラグインへの最終変更はだいぶ前になります!

「いいね!」 1

了解しました!私の方で素早く確認したところ、サーバー所有者として登録されており、管理者権限を持っていることが確認できました。

追記:ボットに必要な権限について明確にできますか?現在、管理者権限が付与されています(これは OAuth 招待ではなく、ロールによって付与されたものです)。

「いいね!」 1

私のボットにはこれがあります:

「いいね!」 1

こちらが私のものです(すいません、ここでは初心者なので

投稿を3回する必要があります…)

「いいね!」 1

チャンネルの権限を確認してもらえますか?Discordのチャンネル権限は、サーバー権限よりも優先されます。

「いいね!」 1

はい、チャンネル内では問題なく動作しています。メッセージの送受信を妨げるような権限設定はされていません。

「Pong!」は送信できますが、!discsync を実行するには必要な権限がないと表示されます。

「いいね!」 1

[quote=“Zavan, 投稿:45, トピック:122530”]
Pong! を送信することはできますが、!discsync を実行するには必要な権限がないと表示されます。[/quote]

「いいね!」 1