prysmaticlabs / prysm

Go implementation of Ethereum proof of stake
https://www.offchainlabs.com
GNU General Public License v3.0
3.47k stars 1k forks source link

Discord Bots are broken #1357

Closed terencechain closed 5 years ago

terencechain commented 5 years ago

Issue fetchers bot and gitter bot are not working. Looks like we need to relaunch the instances somewhere. @rauljordan please provide the creds and document how to launch them

prestonvanloon commented 5 years ago

We can launch these into the upcoming kubernetes cluster, but we need to share the API credentials and discuss the deployment internally.

rauljordan commented 5 years ago

Hi all, the instructions for the bots are as follows:

Github Issue Fetcher

We have a bot that fetches github issues by quoting them as {{issue_num}} on our discord public channels. This is handled by the nodejs repo here: https://github.com/rauljordan/discord-github-issue-fetcher where setup instructions are located in its README.

It requires a discord bot token, which can be obtained by navigating to the discord developer's portal, creating a new application, and creating a new bot. As Jan 24, 2019, one can head to the OAuth2 section of the portal, check the "bot" option, and an OAuth2 URL will be generated which can then be copied and pasted into the URL bar. This will add the bot to the server. Then, head back to the developer portal and go to the bot section, where you can copy the bot's secret token (keep this safe). This is the token needed by the Github Issue Fetcher as specified in its README.

Gitter Discord Bridge

The next part is the Gitter <-> Discord bridge. We use the Matterbridge project with the following configuration:

#WARNING: as this file contains credentials, be sure to set correct file permissions
[gitter.prysmaticlabs]
    #You can get your token by going to https://developer.gitter.im/docs/welcome and SIGN IN
    Token="GITTERTOKEN"
    RemoteNickFormat="[{PROTOCOL}] <{NICK}> "

[discord.mydiscord]
    #You can get your token by following the instructions on
    #https://github.com/42wim/matterbridge/wiki/Discord-bot-setup
    #If you want roles/groups mentions to be shown with names instead of ID,
    #you'll need to give your bot the "Manage Roles" permission.
    Token="DISCORDTOKEN"
    Server="Prysmatic Labs"
    RemoteNickFormat="[{PROTOCOL}] <{NICK}> "

[[gateway]]
name="gateway1"
enable=true
    [[gateway.inout]]
    account="discord.mydiscord"
    channel="gitter"

    [[gateway.inout]]
    account="gitter.prysmaticlabs"
    channel="prysmaticlabs/prysm"

Save the above into a file called matterbridge.toml locally. Then, do the same setup as above in the Github Issue Fetcher to create a new bot on discord and obtain its discord bot token. Now, head over to Gitter to obtain a developer token from their developer portal. These two values can be replaced in the TOML file above where it says DISCORDTOKEN and GITTERTOKEN.

Then, follow the instructions to launch matterbridge on your machine (Docker I found is the easiest) by using the configuration file specified above. Voila!

rauljordan commented 5 years ago

Closing :)