Skip to content
Extraits de code Groupes Projets
Valider 158ddb8a rédigé par Will Hunt's avatar Will Hunt
Parcourir les fichiers

A few things changed in YAML that stopped TS from completing

parent 8a636a09
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -133,7 +133,11 @@ async function run() {
if (!port) {
throw Error("Port not given in command line or config file");
}
config.applyConfig(yaml.safeLoad(fs.readFileSync(configPath, "utf8")));
const readConfig = yaml.safeLoad(fs.readFileSync(configPath, "utf8"));
if (typeof readConfig !== "object") {
throw Error("Config is not of type object");
}
config.applyConfig(readConfig);
Log.Configure(config.logging);
if (config.database.roomStorePath || config.database.userStorePath) {
log.error("The keys 'roomStorePath' and/or 'userStorePath' is still defined in the config. " +
......
......@@ -62,6 +62,6 @@ const yamlConfig = yaml.safeLoad(fs.readFileSync(options.config, "utf8"));
if (yamlConfig === null) {
console.error("You have an error in your discord config.");
}
const url = Util.GetBotLink(yamlConfig);
// We assume the config is well formed in this script
const url = Util.GetBotLink(yamlConfig as any);
console.log(`Go to ${url} to invite the bot into a guild.`);
......@@ -24,7 +24,8 @@ export class ToolsHelper {
homeserverName: config.bridge.domain,
homeserverUrl: config.bridge.homeserverUrl,
port: 0,
registration,
// We assume the registration is well formed
registration: registration as any,
});
const store = needsStore ? new DiscordStore(config.database ? config.database.filename : "discord.db") : null;
......
......@@ -71,7 +71,7 @@ if (options.help || (options.add && options.remove) || !(options.add || options.
process.exit(0);
}
const config: DiscordBridgeConfig = yaml.safeLoad(fs.readFileSync(options.config, "utf8"));
const config: DiscordBridgeConfig = yaml.safeLoad(fs.readFileSync(options.config, "utf8")) as DiscordBridgeConfig;
const discordstore = new DiscordStore(config.database ? config.database : "discord.db");
discordstore.init().then(() => {
log.info("Loaded database.");
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter