Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
M
matrix-appservice-discord
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
salixor
matrix-appservice-discord
Validations
8d2c2734
Valider
8d2c2734
rédigé
Il y a 4 ans
par
Will Hunt
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Use intents
parent
ca04d707
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
4
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
4 fichiers modifiés
config/config.sample.yaml
+3
-0
3 ajouts, 0 suppression
config/config.sample.yaml
config/config.schema.yaml
+2
-0
2 ajouts, 0 suppression
config/config.schema.yaml
src/clientfactory.ts
+11
-2
11 ajouts, 2 suppressions
src/clientfactory.ts
src/config.ts
+1
-0
1 ajout, 0 suppression
src/config.ts
avec
17 ajouts
et
2 suppressions
config/config.sample.yaml
+
3
−
0
Voir le fichier @
8d2c2734
...
@@ -38,6 +38,9 @@ auth:
...
@@ -38,6 +38,9 @@ auth:
# This MUST be a string (wrapped in quotes)
# This MUST be a string (wrapped in quotes)
clientID
:
"
12345"
clientID
:
"
12345"
botToken
:
"
foobar"
botToken
:
"
foobar"
# You must enable "Privileged Gateway Intents" in your bot settings on discord.com (e.g.g https://discord.com/developers/applications/12345/bot)
# for this to work
usePriviledgedIntents
:
false
logging
:
logging
:
# What level should the logger output to the console at.
# What level should the logger output to the console at.
console
:
"
warn"
#silly, verbose, info, http, warn, error, silent
console
:
"
warn"
#silly, verbose, info, http, warn, error, silent
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
config/config.schema.yaml
+
2
−
0
Voir le fichier @
8d2c2734
...
@@ -34,6 +34,8 @@ properties:
...
@@ -34,6 +34,8 @@ properties:
type
:
"
string"
type
:
"
string"
botToken
:
botToken
:
type
:
"
string"
type
:
"
string"
usePriviledgedIntents
:
type
:
"
boolean"
logging
:
logging
:
type
:
"
object"
type
:
"
object"
properties
:
properties
:
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/clientfactory.ts
+
11
−
2
Voir le fichier @
8d2c2734
...
@@ -16,7 +16,7 @@ limitations under the License.
...
@@ -16,7 +16,7 @@ limitations under the License.
import
{
DiscordBridgeConfigAuth
}
from
"
./config
"
;
import
{
DiscordBridgeConfigAuth
}
from
"
./config
"
;
import
{
DiscordStore
}
from
"
./store
"
;
import
{
DiscordStore
}
from
"
./store
"
;
import
{
Client
as
DiscordClient
,
TextChannel
}
from
"
better-discord.js
"
;
import
{
Client
as
DiscordClient
,
Intents
,
TextChannel
}
from
"
better-discord.js
"
;
import
{
Log
}
from
"
./log
"
;
import
{
Log
}
from
"
./log
"
;
import
{
MetricPeg
}
from
"
./metrics
"
;
import
{
MetricPeg
}
from
"
./metrics
"
;
...
@@ -40,8 +40,11 @@ export class DiscordClientFactory {
...
@@ -40,8 +40,11 @@ export class DiscordClientFactory {
// We just need to make sure we have a bearer token.
// We just need to make sure we have a bearer token.
// Create a new Bot client.
// Create a new Bot client.
this
.
botClient
=
new
DiscordClient
({
this
.
botClient
=
new
DiscordClient
({
fetchAllMembers
:
t
rue
,
fetchAllMembers
:
t
his
.
config
.
usePriviledgedIntents
,
messageCacheLifetime
:
5
,
messageCacheLifetime
:
5
,
ws
:
{
intents
:
this
.
config
.
usePriviledgedIntents
?
Intents
.
PRIVILEGED
:
Intents
.
NON_PRIVILEGED
,
}
});
});
const
waitPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
const
waitPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
...
@@ -65,6 +68,9 @@ export class DiscordClientFactory {
...
@@ -65,6 +68,9 @@ export class DiscordClientFactory {
const
client
=
new
DiscordClient
({
const
client
=
new
DiscordClient
({
fetchAllMembers
:
false
,
fetchAllMembers
:
false
,
messageCacheLifetime
:
5
,
messageCacheLifetime
:
5
,
ws
:
{
intents
:
Intents
.
NON_PRIVILEGED
,
}
});
});
await
client
.
login
(
token
,
false
);
await
client
.
login
(
token
,
false
);
...
@@ -95,6 +101,9 @@ export class DiscordClientFactory {
...
@@ -95,6 +101,9 @@ export class DiscordClientFactory {
const
client
=
new
DiscordClient
({
const
client
=
new
DiscordClient
({
fetchAllMembers
:
true
,
fetchAllMembers
:
true
,
messageCacheLifetime
:
5
,
messageCacheLifetime
:
5
,
ws
:
{
intents
:
Intents
.
NON_PRIVILEGED
,
}
});
});
const
jsLog
=
new
Log
(
"
discord.js-ppt
"
);
const
jsLog
=
new
Log
(
"
discord.js-ppt
"
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/config.ts
+
1
−
0
Voir le fichier @
8d2c2734
...
@@ -108,6 +108,7 @@ export class DiscordBridgeConfigDatabase {
...
@@ -108,6 +108,7 @@ export class DiscordBridgeConfigDatabase {
export
class
DiscordBridgeConfigAuth
{
export
class
DiscordBridgeConfigAuth
{
public
clientID
:
string
;
public
clientID
:
string
;
public
botToken
:
string
;
public
botToken
:
string
;
public
usePriviledgedIntents
:
boolean
;
}
}
export
class
DiscordBridgeConfigLogging
{
export
class
DiscordBridgeConfigLogging
{
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter