Skip to content

Commit

Permalink
Remove Twitch stream announcement integration
Browse files Browse the repository at this point in the history
This feature appears to have broken earlier this month, and we have not
been interested in maintaining this particular feature.
  • Loading branch information
Nightfirecat committed Mar 30, 2024
1 parent cc22f69 commit 288ba53
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 157 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
1. Run `npm install`
2. Set env `GITHUB_TOKEN` to your personal GitHub API token
3. Set env `DISCORD_TOKEN` to your Discord bot token
4. Set env `TWITCH_CLIENT_ID` to your Twitch Application Client ID
5. Set env `TWITCH_CLIENT_SECRET` to your Twitch Application Client Secret
5. (optional) Set env `LOG_LEVEL` to `debug` if you want debug logging
6. Run `node lib/app.js` (or without LOG_LEVEL to default to 'info')
4. (optional) Set env `LOG_LEVEL` to `debug` if you want debug logging
5. Run `node lib/app.js` (or without LOG_LEVEL to default to 'info')

![preview](https://i.imgur.com/45plIKX.png)
20 changes: 0 additions & 20 deletions lib/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import fetch from 'node-fetch'
import { Client, Intents } from 'discord.js'
import { log, fetchAuditEntryFor, limitStrTo } from './common.js'
import { updateStream, updateStreams } from './twitch.js'
import { fetchAllContributors } from './contributors.js'
import { fetchBlocked } from './blocked.js'
import { cleanup, processModMail, processModMailReply, processModMailTyping } from './modmail.js'
Expand Down Expand Up @@ -68,7 +67,6 @@ client.on('ready', () => {
scheduleWithFixedDelay(() => resetMessageCache(), 30 * 60000)
scheduleWithFixedDelay(() => pruneDeletedMessages(), 10_000)
scheduleWithFixedDelay(() => pruneRecentlyFlagged(), 5 * 60000)
scheduleWithFixedDelay(() => updateStreams(client.channels), 5 * 60000)
scheduleWithFixedDelay(() => notice.cleanup(), 30_000)
scheduleWithFixedDelay(() => cleanup(), 30_000)
})
Expand Down Expand Up @@ -177,11 +175,6 @@ client.on('messageCreate', async message => {

await addCommand(client.user.id, message.guild, createCommand(name, value))
return message.channel.send(`Successfully added command \`${name}\``)
} else if (command === 'stream') {
const value = args.join(' ').toLowerCase().trim()
updateStream(message.member, value)
updateStreams(client.channels)
return message.channel.send(value ? `Successfully added stream \`${value}\`` : 'Successfully removed stream')
} else if (command === 'cfpurge') {
const arg = args.shift()
if (!arg) {
Expand Down Expand Up @@ -280,19 +273,6 @@ function onMessageEdit (oldMessage, newMessage) {
logs.send(withoutMentions(`:pencil: ${buildUserDetail(user)}'s message was modified: ${messageDetail}`))
}

client.on('presenceUpdate', (oldPresence, newPresence) => {
const newMember = newPresence.member

if (!newMember || !newMember.roles.cache.some(r => r.name.toLowerCase() === config.roles.streams.toLowerCase())) {
return
}

const activity = newPresence.activities && newPresence.activities.find(p => p.type === 'STREAMING')
const url = activity && activity.url

updateStream(newMember, url)
})

client.on('guildBanAdd', async (guildBan) => {
const guild = guildBan.guild
const user = guildBan.user
Expand Down
7 changes: 0 additions & 7 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ export default {
githubToken: process.env.GITHUB_TOKEN,
// This is token used for bot to login, must be from Discord Application who has bot enabled
discordToken: process.env.DISCORD_TOKEN,
// Used for getting information about streamer from Twitch API
twitchClientId: process.env.TWITCH_CLIENT_ID,
twitchClientSecret: process.env.TWITCH_CLIENT_SECRET,
// Discord Application ID for RuneLite
discordAppID: '409416265891971072',
// Bad IDs to flag
Expand All @@ -43,8 +40,6 @@ export default {
channels: {
// Name of Discord channels where custom commands will be ignored
noCustomCommands: ['development'],
// Name of Discord channel where streamers will be announced
streams: 'twitch',
// Name of Discord channel where moderation logs will be sent (user ban/unban, user role change)
moderationLogs: 'mod-logs',
// Name of Discord channel where server logs will be sent (user join/leave)
Expand Down Expand Up @@ -79,8 +74,6 @@ export default {
],
// Name of Discord role that will be used to mute people
muted: 'muted',
// Name of Discord role that will be used to check if user can be announced in streamer channel
streams: 'streamer',
// Name of Discord role that will be given to users authed via GitHub
verified: 'github-verified',
// Name of Discord role that will be given to users that contributed to main github repo
Expand Down
126 changes: 0 additions & 126 deletions lib/twitch.js

This file was deleted.

0 comments on commit 288ba53

Please sign in to comment.