Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Introducing forum feed #127

Merged
merged 6 commits into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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