|
22 | 22 |
|
23 | 23 | from core import checks |
24 | 24 | from core.changelog import Changelog |
25 | | -from core.decorators import github_access_token_required, trigger_typing |
| 25 | +from core.decorators import trigger_typing |
26 | 26 | from core.models import InvalidConfigError, PermissionLevel |
27 | 27 | from core.paginator import PaginatorSession, MessagePaginatorSession |
28 | 28 | from core.utils import cleanup_code, info, error, User, get_perm_level |
@@ -404,102 +404,7 @@ async def debug_clear(self, ctx): |
404 | 404 | color=self.bot.main_color, description="Cached logs are now cleared." |
405 | 405 | ) |
406 | 406 | ) |
407 | | - |
408 | | - @commands.command() |
409 | | - @checks.has_permissions(PermissionLevel.OWNER) |
410 | | - @github_access_token_required |
411 | | - @trigger_typing |
412 | | - async def github(self, ctx): |
413 | | - """Shows the GitHub user your Github_Access_Token is linked to.""" |
414 | | - data = await self.bot.api.get_user_info() |
415 | | - |
416 | | - embed = Embed( |
417 | | - title="GitHub", description="Current User", color=self.bot.main_color |
418 | | - ) |
419 | | - user = data["user"] |
420 | | - embed.set_author( |
421 | | - name=user["username"], icon_url=user["avatar_url"], url=user["url"] |
422 | | - ) |
423 | | - embed.set_thumbnail(url=user["avatar_url"]) |
424 | | - await ctx.send(embed=embed) |
425 | | - |
426 | | - @commands.command() |
427 | | - @checks.has_permissions(PermissionLevel.OWNER) |
428 | | - @github_access_token_required |
429 | | - @trigger_typing |
430 | | - async def update(self, ctx, *, flag: str = ""): |
431 | | - """ |
432 | | - Update Modmail. |
433 | | -
|
434 | | - This only works for Heroku users who have configured their bot for updates. |
435 | | -
|
436 | | - To stay up-to-date with the latest commit |
437 | | - from GitHub, specify "force" as the flag. |
438 | | - """ |
439 | | - |
440 | | - changelog = await Changelog.from_url(self.bot) |
441 | | - latest = changelog.latest_version |
442 | | - |
443 | | - desc = ( |
444 | | - f"The latest version is [`{self.bot.version}`]" |
445 | | - "(https://github.com/kyb3r/modmail/blob/master/bot.py#L25)" |
446 | | - ) |
447 | | - |
448 | | - if ( |
449 | | - parse_version(self.bot.version) >= parse_version(latest.version) |
450 | | - and flag.lower() != "force" |
451 | | - ): |
452 | | - embed = Embed( |
453 | | - title="Already up to date", description=desc, color=self.bot.main_color |
454 | | - ) |
455 | | - |
456 | | - data = await self.bot.api.get_user_info() |
457 | | - if not data.get("error"): |
458 | | - user = data["user"] |
459 | | - embed.set_author( |
460 | | - name=user["username"], icon_url=user["avatar_url"], url=user["url"] |
461 | | - ) |
462 | | - else: |
463 | | - data = await self.bot.api.update_repository() |
464 | | - |
465 | | - commit_data = data["data"] |
466 | | - user = data["user"] |
467 | | - |
468 | | - if commit_data: |
469 | | - embed = Embed(color=self.bot.main_color) |
470 | | - |
471 | | - embed.set_footer( |
472 | | - text=f"Updating Modmail v{self.bot.version} " |
473 | | - f"-> v{latest.version}" |
474 | | - ) |
475 | | - |
476 | | - embed.set_author( |
477 | | - name=user["username"] + " - Updating bot", |
478 | | - icon_url=user["avatar_url"], |
479 | | - url=user["url"], |
480 | | - ) |
481 | | - |
482 | | - embed.description = latest.description |
483 | | - for name, value in latest.fields.items(): |
484 | | - embed.add_field(name=name, value=value) |
485 | | - # message = commit_data['commit']['message'] |
486 | | - html_url = commit_data["html_url"] |
487 | | - short_sha = commit_data["sha"][:6] |
488 | | - embed.add_field( |
489 | | - name="Merge Commit", value=f"[`{short_sha}`]({html_url})" |
490 | | - ) |
491 | | - else: |
492 | | - embed = Embed( |
493 | | - title="Already up to date with master repository.", |
494 | | - description="No further updates required", |
495 | | - color=self.bot.main_color, |
496 | | - ) |
497 | | - embed.set_author( |
498 | | - name=user["username"], icon_url=user["avatar_url"], url=user["url"] |
499 | | - ) |
500 | | - |
501 | | - return await ctx.send(embed=embed) |
502 | | - |
| 407 | + |
503 | 408 | @commands.command(aliases=["presence"]) |
504 | 409 | @checks.has_permissions(PermissionLevel.ADMINISTRATOR) |
505 | 410 | async def activity(self, ctx, activity_type: str.lower, *, message: str = ""): |
|
0 commit comments