1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 16:30:58 -05:00

Compare commits

...

3 Commits

Author SHA1 Message Date
toast-ts
a261407ec8 Test commit, nothing important except the laundry 2024-05-29 23:27:08 +10:00
toast-ts
93e24ba48c Use temporary branch instead of default 2024-05-29 23:25:46 +10:00
toast-ts
68fffba887 Improved the regex pattern for handling invite links 2024-05-29 23:21:34 +10:00
2 changed files with 3 additions and 3 deletions

View File

@ -56,9 +56,9 @@ export default class MessageCreate {
},*/ },*/
{ {
name: 'discordInvite', name: 'discordInvite',
check: ()=>message.content.toLowerCase().match(/discord\.(gg|com\/invite)\//ig) && !MessageTool.isStaff(message.member as Discord.GuildMember), check: ()=>message.content.toLowerCase().match(/(https?:\/\/)?(.*?@)?(www\.)?(discord\.(gg)|discord(app)?\.com\/invite)\/(?<code>[\w-]+)/ui) && !MessageTool.isStaff(message.member as Discord.GuildMember),
action: async()=>{ action: async()=>{
const validInvite = await client.fetchInvite(message.content.split(' ').find(x=>x.match(/discord\.(gg|com\/invite)\//ig))).catch(()=>null); const validInvite = await client.fetchInvite(message.content.split(' ').find(x=>x.match(/(https?:\/\/)?(.*?@)?(www\.)?(discord\.(gg)|discord(app)?\.com\/invite)\/(?<code>[\w-]+)/ui))).catch(()=>null);
if (validInvite && validInvite.guild?.id !== client.config.dcServer.id) { if (validInvite && validInvite.guild?.id !== client.config.dcServer.id) {
automodded = true; automodded = true;
message.delete().catch(()=>Logger.console('log', `${automodLog}Advertisement`, automodFailReason)); message.delete().catch(()=>Logger.console('log', `${automodLog}Advertisement`, automodFailReason));

View File

@ -8,7 +8,7 @@ import git from 'simple-git';
const octokit = new Octokit({auth: (await TSClient()).octokit, timeZone: 'Australia/NSW', userAgent: 'Daggerbot-TS'}); const octokit = new Octokit({auth: (await TSClient()).octokit, timeZone: 'Australia/NSW', userAgent: 'Daggerbot-TS'});
export default class GitHub { export default class GitHub {
private static repositoryConfig = {owner: 'toast-ts', ref: 'HEAD'}; private static repositoryConfig = {owner: 'toast-ts', ref: 'temp'};
public static async RemoteRepository() { public static async RemoteRepository() {
const {data} = await octokit.repos.getCommit({repo: 'Daggerbot-TS', ...this.repositoryConfig}); const {data} = await octokit.repos.getCommit({repo: 'Daggerbot-TS', ...this.repositoryConfig});
return data; return data;