/[sudobot]/trunk/src/api/Server.ts
ViewVC logotype

Diff of /trunk/src/api/Server.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 53 by rakin, Mon Jul 29 17:28:23 2024 UTC revision 66 by rakin, Mon Jul 29 17:28:27 2024 UTC
# Line 16  export default class Server { Line 16  export default class Server {
16    
17      constructor(protected client: DiscordClient) {      constructor(protected client: DiscordClient) {
18          this.app = express();          this.app = express();
19          this.guildData = JSON.parse(readFileSync(path.resolve(__dirname, '..', '..', 'config', 'apiguilds.json')).toString());          const data: typeof this.guildData = {};
20    
21            for (const key of Object.keys(process.env)) {
22                if (key.startsWith('TOKEN_')) {
23                    data[key.replace(/^TOKEN_/g, '')] = {
24                        token: process.env[key]!
25                    };
26                }
27            }
28    
29            this.guildData = data;
30            console.log(data);        
31      }      }
32    
33      verifyToken(guild: string, token: string): boolean {      verifyToken(guild: string, token: string): boolean {

Legend:
Removed from v.53  
changed lines
  Added in v.66

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26