Skip to content

Commit

Permalink
✨ Introducing forum feed (Skript-MC#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
Romitou authored Jan 19, 2021
1 parent c0844cf commit 2f8e8e6
Show file tree
Hide file tree
Showing 7 changed files with 6,924 additions and 1,784 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ DISCORD_TOKEN=""
SENTRY_TOKEN=""
# Skript-MC's API token
SKRIPTMC_TOKEN=""
# Skript-MC's forum API token
SKRIPTMC_FORUM_TOKEN=""

# +----------------------+
# | URLs |
Expand Down Expand Up @@ -66,6 +68,8 @@ LOG_CHANNEL=""
PRIVATE_CHANNEL_CATEGORY=""
# Main channel (#general)
MAIN_CHANNEL=""
# Forum news feed channel
FORUM_FEED_CHANNEL=""

# +----------------------+
# | Emojis IDs |
Expand Down
2 changes: 2 additions & 0 deletions config/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default {
hastebin: 'https://hastebin.com/documents',
addons: 'https://api.skripttools.net/v4/addons/',
skriptmc: 'https://skript-mc.fr/api/',
forum: 'https://skript-mc.fr/forum/api/',
},
roles: {
staff: process.env.STAFF_ROLE,
Expand All @@ -75,6 +76,7 @@ export default {
creations: process.env.SKRIPT_CREATIONS_CHANNEL,
log: process.env.LOG_CHANNEL,
privateChannelsCategory: process.env.PRIVATE_CHANNEL_CATEGORY,
forumUpdates: process.env.FORUM_FEED_CHANNEL,
},
emojis: {
yes: process.env.YES_EMOJI || '✅',
Expand Down
31 changes: 30 additions & 1 deletion config/tasks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
// eslint-disable-next-line import/prefer-default-export
export const skriptReleases = {
releaseAnnouncement: 'Une nouvelle version de Skript vient d\'être publiée ; vous pouvez la télécharger et consulter les changements ci-dessous.',
githubEndpoint: '/repos/SkriptLang/Skript/releases',
dataProvider: 'Données fournies par https://github.com',
timeDifference: 600_000,
};

export const forumFeed = {
timeDifference: 600_000,
dataProvider: 'Automatiquement envoyé depuis Skript-MC',
baseAxiosParams: {
params: {
page: 1, // Fetch the 25 first objects, more is useless
hidden: 0, // Don't show hidden objects
sortBy: 'updated', // Sort by updates, also including new contents
sortDir: 'desc', // Get most recent updates or new contents
},
auth: {
username: process.env.SKRIPTMC_FORUM_TOKEN,
password: null,
},
},
endpoints: {
files: {
files: 'downloads/files',
categories: 'downloads/categories',
comments: 'downloads/comments',
reviews: 'downloads/reviews',
},
forums: {
forums: 'forums/forums',
posts: 'forums/posts',
topics: 'forums/topics',
},
},
};
Loading

0 comments on commit 2f8e8e6

Please sign in to comment.